Get the current context (as much as we can) on startup See: http://johnliu.net/blog/2012/2/3/sharepoint-javascript-current-page-context-info.html
166706
function SPServicesContext() {

        // The SharePoint variables only give us a relative path. to match the result from WebUrlFromPageUrl, we need to add the protocol, host, and (if present) port.
        var siteRoot = location.protocol + "//" + location.host + (location.port !== "" ? location.port : "");

        // SharePoint 2010 gives us a context variable
        if (typeof _spPageContextInfo !== "undefined") {
            this.thisSite = siteRoot + _spPageContextInfo.webServerRelativeUrl;
            this.thisList = _spPageContextInfo.pageListId;
            this.thisUserId = _spPageContextInfo.userId;
            // In SharePoint 2007, we know the UserID only
        } else {
            this.thisSite = (typeof L_Menu_BaseUrl !== "undefined") ? siteRoot + L_Menu_BaseUrl : "";
            this.thisList = "";
            this.thisUserId = (typeof _spUserId !== "undefined") ? _spUserId : undefined;
        }

    }
1208761
def _get_context_id(self):
        """"""

        from furious.context import get_current_context

        context_id = self._options.get('context_id')

        if context_id:
            return context_id

        try:
            context = get_current_context()
        except errors.NotInContextError:
            context = None
            self.update_options(context_id=None)

        if context:
            context_id = context.id
            self.update_options(context_id=context_id)

        return context_id
935564
def get_context(namespace, context_id):
    """"""
    context_obj = get_state(context_id, namespace=namespace)
    if not context_obj:
        raise ContextError("Context '{}' not found in namespace '{}'".format(
            context_id, namespace))
    return context_obj
76773
function _getPrefsContext() {
        var projectRoot = ProjectManager.getProjectRoot();  // note: null during unit tests!
        return { location : { scope: "user", layer: "project", layerID: projectRoot && projectRoot.fullPath } };
    }
550519
def get_context_data(self, **kwargs):
        
        context = super().get_context_data(**kwargs)

        # Computes the number of topics added by the considered member
        context['topics_count'] = (
            Topic.objects.filter(approved=True, poster=self.object.user).count()
        )

        # Fetches the recent posts added by the considered user
        forums = self.request.forum_permission_handler.get_readable_forums(
            Forum.objects.all(), self.request.user,
        )
        recent_posts = (
            Post.approved_objects
            .select_related('topic', 'topic__forum')
            .filter(topic__forum__in=forums, poster=self.object.user)
            .order_by('-created')
        )
        context['recent_posts'] = recent_posts[:machina_settings.PROFILE_RECENT_POSTS_NUMBER]

        return context
948088
function getPreLoadPage(options, context) {
    var load = options.load;
    if (!load) {
        return;
    }

    if (load === true && options.host) {
        load = [options.host];
    }
    else {
        if (!Array.isArray(load)) {
            load = [load];
        }

        if (_.isString(load[0])) {
            load = context.findFileByPattern(load);
        }
    }
    return load;
}
208536
function getContext(i) {
  if (context) {
    return context
  } else {
    const path = getCallsite(i || 2).getFileName()
    const file = files[path]
    if (file) return file.group
    throw Error(`Test module was not loaded properly: "${path}"`)
  }
}
850155
def get_context(self):
        
        if not self.is_valid():
            raise ValueError("Cannot generate Context when form is invalid.")
        return dict(request=self.request, **self.cleaned_data)
590551
def get_context_data(self, **kwargs):
        
        context = super().get_context_data(**kwargs)
        context['question'] = self.question
        topic = self.get_object()
        context['forum'] = topic.forum
        return context
599170
def init_with_context(self, context):
        
        super(ReturnToSiteItem, self).init_with_context(context)

        # See if the current page is being edited, update URL accordingly.
        edited_model = self.get_edited_object(context['request'])
        if edited_model:
            try:
                url = edited_model.get_absolute_url()
            except (AttributeError, urls.NoReverseMatch) as e:
                pass
            else:
                if url:
                    self.url = url
483776
public static UIContext getCurrent() {
		Stack<UIContext> stack = CONTEXT_STACK.get();

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

		return getStack().peek();
	}
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
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();
    }
336531
def get_context_data(self,**kwargs):
        '''  '''
        context = self.get_listing()
        context['showDescriptionRule'] = getConstant('registration__showDescriptionRule') or 'all'
        context.update(kwargs)

        # Update the site session data so that registration processes know to send return links to
        # the registration page.  set_return_page() is in SiteHistoryMixin.
        self.set_return_page('registration',_('Registration'))

        return super(ClassRegistrationView,self).get_context_data(**context)
353697
def getContext(self):
        """"""
        ctx = ClientContextFactory.getContext(self)
        ctx.set_options(OP_NO_SSLv3)
        return ctx
315165
def get_context():
    """"""
    if not local_context._options:
        raise TelluricContextError("TelluricContext context not exists")
    else:
        log.debug("Got a copy of context %r options", local_context._options)
        return local_context._options.copy()
32797
public static XmlWebApplicationContext getAppContext(Page page) {
        return page == null ? null : (XmlWebApplicationContext) page.getAttribute(APP_CONTEXT_ATTRIB);
    }