Return a reference to the current Context object.
497809
def get_current_context():
    
    local_context = _local.get_local_context()

    if local_context.registry:
        return local_context.registry[-1]

    raise errors.NotInContextError('Not in a Context.')
667426
def set_current_context(self, name):
        """"""
        if self.context_exists(name):
            self.data['current-context'] = name
        else:
            raise KubeConfError("Context does not exist.")
1316107
def _get_context_key(self, **kwargs):
        
        return str(kwargs.get(self._resource.parent.id_name))
18019
def get_context_data(self, **kwargs):
        """"""
        kwargs.update({
            'methods': registry.get_all_methods(self.entry_point, sort_methods=True),
        })
        return super(RPCEntryPoint, self).get_context_data(**kwargs)
558285
public static function getContext()
    {
        $coID = Coroutine::getuid();
        if(!isset(static::$context[$coID]))
        {
            throw new \RuntimeException('get context failed, current context is not found');
        }
        return static::$context[$coID];
    }
778886
def current(cls, with_exception=True):
        
        if with_exception and len(cls.stack) == 0:
            raise NoContext()
        return cls.stack.top()
593524
def make_context(self, **kwargs):
        """"""
        self.check_schema()
        return Context(self.driver, self.config, **kwargs)
1013640
def get_current_context_id():
    
    global get_current_context_id
    if greenlet is not None:
        if stackless is None:
            get_current_context_id = greenlet.getcurrent
            return greenlet.getcurrent()
        return greenlet.getcurrent(), stackless.getcurrent()
    elif stackless is not None:
        get_current_context_id = stackless.getcurrent
        return stackless.getcurrent()
    get_current_context_id = _thread.get_ident
    return _thread.get_ident()
1058503
def update_context(self, ctx):
        
        assert isinstance(ctx, dict)
        ctx[str(self.context_id)] = self.value
1272309
def context(self):
        
        parent = _ACTION_CONTEXT.set(self)
        try:
            yield self
        finally:
            _ACTION_CONTEXT.reset(parent)
1363878
def ref_context_from_geoloc(geoloc):
    """"""
    text = geoloc.get('text')
    geoid = geoloc.get('geoID')
    rc = RefContext(name=text, db_refs={'GEOID': geoid})
    return rc
479903
def get_context(self):
        
        if not self.context:
            return
        else:
            assert isinstance(self.context, tuple), 'Expected a Tuple not {0}'.format(type(self.context))
        for model in self.context:
            model_cls = utils.get_model_class(model)
            key = utils.camel_to_snake(model_cls.__name__)
            self.context_data[key] = self.get_instance_of(model_cls)
1157884
public Context getContext() {
		if (context == null) {
			context = Model.getSingleton().getSession().getContext(this.contextId);
		}
		return context;
	}
313142
def get_context(self, name, value, attrs):
        """"""
        context = super().get_context(
            name, value, attrs)
        context['widget']['attrs']['dp_config'] = json_dumps(self.config)
        return context
192368
def user(self):
        
        return self.users.get(self.contexts[self.current_context].get("user", ""), {})
962393
def get_context(method):
    
    if Context.exists(method):
        return Context.increment(method)
    else:
        return Context(method)
21388
def from_context(cls):
        
        try:
            ctx = click.get_current_context()
        except RuntimeError:
            return cls()
        return ctx.find_object(cls)