Obtains a context object optimized for accessing the current thread.
481435
private static <T> ThreadContext<T> getCurrentThreadContext(ThreadContext<T> threadContext)
    {
        return ((ThreadContextImpl<T>) threadContext).get();
    }
483776
public static UIContext getCurrent() {
		Stack<UIContext> stack = CONTEXT_STACK.get();

		if (stack == null || stack.isEmpty()) {
			return null;
		}

		return getStack().peek();
	}
508430
public static synchronized ContextHolder getInstance() {

        if (INSTANCE == null) {
            Properties props = new Properties();
            try {
                props.load(new ClassPathResource("/cudafunctions.properties", ContextHolder.class.getClassLoader()).getInputStream());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }

            INSTANCE = new ContextHolder();
            INSTANCE.configure();


            //set the properties to be accessible globally
            for (String pair : props.stringPropertyNames())
                System.getProperties().put(pair, props.getProperty(pair));


        }


        return INSTANCE;
    }
1020443
public static RpcInvokeContext getContext() {
        RpcInvokeContext context = LOCAL.get();
        if (context == null) {
            context = new RpcInvokeContext();
            LOCAL.set(context);
        }
        return context;
    }
282343
public static RequestContext get() {
        if (CURRENT_CONTEXT.get() == null) {
            synchronized (RequestContext.class) {
                if (CURRENT_CONTEXT.get() == null) {
                    createContext();
                }
            }
        }

        // ensure that RequestContextV1 is also initialized for this request
        RequestContextV1.get();

        return CURRENT_CONTEXT.get();
    }
927867
private Context getContext(ExecutionContext executionContext) {
        // Get context id.
        HttpServletRequest request = executionContext.getActionBeanContext().getRequest();
        String parameter = request.getParameter(ID_PARAMETER);
        
        // Return context.
        if (parameter != null) {
            int id = Integer.parseInt(parameter, 16);
            return contexts.get(id);
        }
        
        return null;
    }
764733
Object getServletContextForCurrentClassLoader() {
        Object result;
        FactoryManagerCacheKey key = new FactoryManagerCacheKey(null, getClassLoader(), applicationMap);
        result = key.getContext();
        
        return result;
    }
1236416
@SuppressWarnings("unchecked")
    private ThreadContextDescriptor captureRaThreadContext(WSContextService contextSvc) {
        Map<String, String> execProps = new HashMap<String, String>();
        execProps.put(WSContextService.DEFAULT_CONTEXT, WSContextService.ALL_CONTEXT_TYPES);
        execProps.put(WSContextService.REQUIRE_AVAILABLE_APP, "false");

        return contextSvc.captureThreadContext(execProps);
    }
582655
def sg_get_context():
    
    """

    global _context

    # merge current context
    res = tf.sg_opt()
    for c in _context:
        res += c

    return res
969231
public static final CThreadContext getInstance() {
		SoftReference ref = (SoftReference)CThreadContext.contextLocal
				.get(Thread.currentThread());
		CThreadContext context = null;
		if ((ref == null) || (ref.get() == null)) {
			context = new CThreadContext();
			ref = new SoftReference(context);
			CThreadContext.contextLocal.put(Thread.currentThread(), ref);
		} else {
			context = (CThreadContext)ref.get();
		}
		return context;
	}
316100
def get_thread(self, thread_key):
		'''
		'''
		uri = '/'.join([self.api_uri,
						self.threads_suffix,
						thread_key
						])
		return self._req('get', uri)
638615
function(_context) {
        if(this.is_object(_context)) {
          return _context;
        } else {
          var iterator = ".";
          if(this.pragmas["IMPLICIT-ITERATOR"]) {
            iterator = this.pragmas["IMPLICIT-ITERATOR"].iterator;
          }
          var ctx = {};
          ctx[iterator] = _context;
          return ctx;
        }
      }
1157884
public Context getContext() {
		if (context == null) {
			context = Model.getSingleton().getSession().getContext(this.contextId);
		}
		return context;
	}
720609
public static ApplicationContext get() {
        ClassLoader classLoader = getContextClassLoader();
        while (classLoader != null) {
            ApplicationContext applicationContext = contextMap.get(classLoader);
            if (applicationContext != null) {
                return applicationContext;
            }
            classLoader = classLoader.getParent();
        }
        return null;
    }
315293
public com.google.api.Context getContext() {
    return context_ == null ? com.google.api.Context.getDefaultInstance() : context_;
  }
1278527
public <R> R accessContext(ContextAccess<C,R> access)
    {
        contextLock.lock();
        try
        {
            return access.access(context);
        }
        finally
        {
            contextLock.unlock();
        }
    }
38057
public function getContextObject() {
		if ($this->contextObj) {
			return $this->contextObj;
		}
		return $this->contextObj = $this->getContextObjectWithIDAndClass($this->getContextID(), $this->getContextType());
	}