get an objectsctore connection
337600
def get_connection(store_settings: dict={}) -> Connection:
    
    store = store_settings

    if not store_settings:
        store = make_config_from_env()

    os_options = {
        'tenant_id': store['TENANT_ID'],
        'region_name': store['REGION_NAME'],
        # 'endpoint_type': 'internalURL'
    }

    # when we are running in cloudvps we should use internal urls
    use_internal = os.getenv('OBJECTSTORE_LOCAL', '')
    if use_internal:
        os_options['endpoint_type'] = 'internalURL'

    connection = Connection(
        authurl=store['AUTHURL'],
        user=store['USER'],
        key=store['PASSWORD'],
        tenant_name=store['TENANT_NAME'],
        auth_version=store['VERSION'],
        os_options=os_options
    )

    return connection
159030
protected Connection getConnectionQuite(DataSource ds) {
		try {
			return Trans.getConnectionAuto(ds);
		} catch (SQLException e) {
			throw new RuntimeException(e);
		}
	}
1320315
public String getObject(Component component) {
		if(objectModel!=null)
		{
			T object = objectModel.getObject();
			if(object==null) return null;
			resourceKey = getResourceKey(object);
		}
		String defaultValue = getDefault();
		if(defaultValue==null) defaultValue = Strings.lastPathComponent(resourceKey, '.');
		if(defaultValue!=null) defaultValue = buitify(defaultValue);
		return Application.get()
				.getResourceSettings()
				.getLocalizer()
				.getString(resourceKey, null, defaultValue);
	}
448809
@Override
    public Object get(int index, Scriptable start)
    {
        if (externalData != null) {
            if (index < externalData.getArrayLength()) {
                return externalData.getArrayElement(index);
            }
            return Scriptable.NOT_FOUND;
        }

        Slot slot = slotMap.query(null, index);
        if (slot == null) {
            return Scriptable.NOT_FOUND;
        }
        return slot.getValue(start);
    }
818184
@Override
    public Object getObjectInstance(Object o, Name n, Context c, Hashtable<?, ?> envmt) throws Exception {

        if (tc.isEntryEnabled()) {
            Tr.entry(tc, "getObjectInstance: o=" + o + ",name=" + n + ",context=" + c + ",evnmt=" + envmt);
        }

        if (!(o instanceof Reference)) {
            if (tc.isEntryEnabled()) {
                Tr.exit(tc, "Object " + o + " is not an instance of javax.naming.Reference. Returning null.");
            }
            return null;
        }
        Reference ref = (Reference) o;
        final Class<?> contextClass = Class.forName(ref.getClassName());
        if (tc.isDebugEnabled())
            Tr.debug(tc, "Creating a proxy for type {0}", contextClass);
        Object proxy = null;

        if (Application.class.equals(contextClass)) {
            if (tc.isDebugEnabled()) {
                Tr.debug(tc, "This is an Application sub-class being injected. Injecting an instance of ApplicationInjectionProxy.");
            }
            proxy = new ApplicationInjectionProxy();
        } else if (HttpServletRequest.class.equals(contextClass)) {
            if (tc.isDebugEnabled()) {
                Tr.debug(tc, "This is an HttpServletRequest sub-class being injected. Injecting an instance of HttpServletRequestInjectionProxy.");
            }
            proxy = new HttpServletRequestInjectionProxy();
        } else if (HttpServletResponse.class.equals(contextClass)) {
            if (tc.isDebugEnabled()) {
                Tr.debug(tc, "This is an HttpServletResponse sub-class being injected. Injecting an instance of HttpServletResponseInjectionProxy.");
            }
            proxy = new HttpServletResponseInjectionProxy();
        } else {
            proxy = Proxy.newProxyInstance(priv.getClassLoader(contextClass),
                                           new Class[] { contextClass },
                                           new InvocationHandler() {
                                               @Override
                                               public Object invoke(Object proxy,
                                                                    Method method,
                                                                    Object[] args) throws Throwable {
                                                   // Without these entry and exit calls RAS uses bytecode injection
                                                   // to insert Tr.entry on first line of this method and then Tr.exit
                                                   // on last lie. Tr.entry attempts to call proxy.toString(), which
                                                   // loops back to the invoke method again--hence resulting in a
                                                   // StackOverflowError
                                                   if (tc.isEntryEnabled()) {
                                                       Tr.entry(tc, "invoke");
                                                   }

                                                   Object result = null;
                                                   // use runtimeContext from TLS
                                                   InjectionRuntimeContext runtimeContext = InjectionRuntimeContextHelper.getRuntimeContext();

                                                   if ("toString".equals(method.getName()) && (method.getParameterTypes().length == 0)) {
                                                       result = "Proxy for " + contextClass.getName();
                                                       if (tc.isEntryEnabled()) {
                                                           Tr.exit(tc, "invoke", result);
                                                       }
                                                       return result;
                                                   }

                                                   // get the real context from the RuntimeContext
                                                   Object context = runtimeContext.getRuntimeCtxObject(contextClass.getName());
                                                   if (context != null) {
                                                       result = method.invoke(context, args);
                                                   }

                                                   if (tc.isEntryEnabled()) {
                                                       Tr.exit(tc, "invoke", result);
                                                   }
                                                   // invoke the method on the real context
                                                   return result;
                                               }
                                           });
        }

        if (tc.isEntryEnabled()) {
            Tr.exit(tc, "getObjectInstance", proxy);
        }

        return proxy;

    }
747637
Connection getConnection(final String alias) throws SQLException {
		if (connection == null) {
			connection = connectionSupplier.getConnection(alias);
			initSavepoints(connection);
		}
		return connection;
	}
185880
@FFDCIgnore(PrivilegedActionException.class)
    private Object getJNDIServiceObjectInstance(final String className, final String bindingName, final Hashtable<?, ?> envmt) throws Exception {
        try {
            return AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
                @Override
                public Object run() throws Exception {
                    return getJNDIServiceObjectInstancePrivileged(className, bindingName, envmt);
                }
            });
        } catch (PrivilegedActionException paex) {
            Throwable cause = paex.getCause();
            if (cause instanceof Exception) {
                throw (Exception) cause;
            }
            throw new Error(cause);
        }
    }
1367284
@Override
    public Object getObjectInstance(Object o, Name n, Context c, Hashtable<?, ?> envmt) throws Exception {
        @SuppressWarnings("unchecked")
        Hashtable<String, Object> env = (Hashtable<String, Object>) envmt;
        return (o instanceof Reference) ? resolve((Reference) o, env) : null;
    }
568934
public T getObject(Connection conn, DataObject object) throws Exception {
        return executeSelect(conn, object, new ResultSetMapper<SingleObjectCollector<T>>(new SingleObjectCollector<T>())).value;
    }
64802
private static Connection getConnection(WorkspaceEntry wsEntry) throws DBCleanException
   {
      String dsName = getSourceNameParameter(wsEntry);

      DataSource ds;
      try
      {
         ds = (DataSource)new InitialContext().lookup(dsName);
      }
      catch (NamingException e)
      {
         throw new DBCleanException(e);
      }

      if (ds == null)
      {
         throw new DBCleanException("Data source " + dsName + " not found");
      }

      final DataSource dsF = ds;

      Connection jdbcConn;
      try
      {
         jdbcConn = SecurityHelper.doPrivilegedSQLExceptionAction(new PrivilegedExceptionAction<Connection>()
         {
            public Connection run() throws Exception
            {
               return dsF.getConnection();
            }
         });
      }
      catch (SQLException e)
      {
         throw new DBCleanException(e);
      }

      return jdbcConn;
   }
801890
def _get_current_object(self):
        
        if not hasattr(self.__local, '__release_local__'):
            return self.__local()
        try:
            return getattr(self.__local, self.__name__)
        except AttributeError:
            raise RuntimeError('no object bound to %s' % self.__name__)
637493
Connection getDataSourceConnection() {
        Connection connection = null;
        try {
            connection = dataSource.getConnection();
        } catch (SQLException ex) {
            throw new InitializationException("Could not obtain the db connection: Cannot get connection", ex);
        }
        return connection;
    }
541257
@Path("connection")
    public DirectoryObjectResource<Connection, APIConnection> getConnection()
            throws GuacamoleException {

        // Return the underlying connection as a resource
        return connectionDirectoryResourceFactory
                .create(userContext, userContext.getConnectionDirectory())
                .getObjectResource(activeConnection.getConnectionIdentifier());

    }
428169
def get(cls, dbname="perfdump"):
        
        try:
            return cls.connection
        except:
            cls.connect(dbname)
            return cls.connection
282789
@Override
    public RemoteObjectInstance getRemoteObjectInstance(String appName, String moduleName, String compName, String namespaceString,
                                                        String jndiName) throws NamingException, RemoteException {
        NamingConstants.JavaColonNamespace namespace = NamingConstants.JavaColonNamespace.fromName(namespaceString);
        ComponentMetaData cmd = getCMD(appName, moduleName, compName, namespace);

        RemoteObjectInstance roi = null;
        try {
            ComponentMetaDataAccessorImpl.getComponentMetaDataAccessor().beginContext(cmd);

            Iterator<RemoteJavaColonNamingHelper> remoteJCNHelpers = remoteJavaColonNamingHelpers.getServices();
            while (remoteJCNHelpers.hasNext()) {
                RemoteJavaColonNamingHelper helper = remoteJCNHelpers.next();
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                    Tr.debug(tc, "getRemoteObjectInstance - checking " + helper);
                }
                roi = helper.getRemoteObjectInstance(namespace, jndiName);
                if (roi != null)
                    break;
            }
        } finally {
            ComponentMetaDataAccessorImpl.getComponentMetaDataAccessor().endContext();
        }

        return roi;
    }
218102
def get_referenced_object(self):
        

        if self._DeviceServer is not None:
            return self._DeviceServer

        raise exception.BunqException(self._ERROR_NULL_FIELDS)
953974
public Object getObjectInstance(Object obj, Name name,
                                    Context nameCtx, Hashtable<?, ?> environment)
        throws Exception
    {
        Reference ref = (Reference) obj;

        String api = null;
        String url = null;

        for (int i = 0; i < ref.size(); i++) {
            RefAddr addr = ref.get(i);

            String type = addr.getType();
            String value = (String) addr.getContent();

            if (type.equals("type"))
                api = value;
            else if (type.equals("url"))
                url = value;
            else if (type.equals("user"))
                setUser(value);
            else if (type.equals("password"))
                setPassword(value);
        }

        if (url == null)
            throw new NamingException("`url' must be configured for HessianProxyFactory.");
        // XXX: could use meta protocol to grab this
        if (api == null)
            throw new NamingException("`type' must be configured for HessianProxyFactory.");

        Class apiClass = Class.forName(api, false, _loader);

        return create(apiClass, url);
    }