Request the SharePoint Context Info
497379
public function requestFormDigest()
    {
        $request = new RequestOptions($this->getServiceRootUrl() . "contextinfo");
        $request->Method = HttpMethod::Post;
        $response = $this->executeQueryDirect($request);
        if(!isset($this->contextWebInformation))
            $this->contextWebInformation = new ContextWebInformation();
        $result = new ClientResult($this->contextWebInformation);
        if ($this->getSerializerContext()->MetadataLevel == ODataMetadataLevel::Verbose) {
            $this->getSerializerContext()->RootElement = "GetContextWebInformation";
        }
        $payload = json_decode($response);
        $result->fromJson($payload,$this->getSerializerContext());
    }
28735
def context_info(zap_helper, context_name):
    """"""
    with zap_error_handler():
        info = zap_helper.get_context_info(context_name)

    console.info('ID: {}'.format(info['id']))
    console.info('Name: {}'.format(info['name']))
    console.info('Authentication type: {}'.format(info['authType']))
    console.info('Included regexes: {}'.format(info['includeRegexs']))
    console.info('Excluded regexes: {}'.format(info['excludeRegexs']))
178209
def fuse_get_context():
    ''

    ctxp = _libfuse.fuse_get_context()
    ctx = ctxp.contents
    return ctx.uid, ctx.gid, ctx.pid
787612
def get_context_data(self):
        
        self.get_context()
        self.context_data.update(self.get_extra_context())
        return self.context_data
864862
def get_xml_request(self):
        
        def wrap_xml_content(xml_content):
            """ Wrap XML content string in the correct CPS request envelope."""
            fields = ['<?xml version="1.0" encoding="utf-8"?>\n',
                      '<cps:request xmlns:cps="www.clusterpoint.com">\n',
                      '<cps:storage>', self.connection._storage, '</cps:storage>\n']
            if self.timestamp:
                fields += []    # TODO: implement
            if self.request_id:
                fields += ['<cps:request_id>', str(self.request_id), '</cps:request_id>\n']
            if self.connection.reply_charset:
                fields += []    # TODO: implement
            if self.connection.application:
                fields += ['<cps:application>', self.connection.application, '</cps:application>\n']
            fields += ['<cps:command>', self._command, '</cps:command>\n',
                       '<cps:user>', self.connection._user, '</cps:user>\n',
                       '<cps:password>', self.connection._password, '</cps:password>\n',
                       '<cps:account>', self.connection._account, '</cps:account>\n']
            if self.timeout:
                fields += ['<cps:timeout>', str(self.timeout), '</cps:timeout>\n']
            if self.type:
                fields += ['<cps:type>', self.type, '</cps:type>\n']
            if xml_content:
                fields += ['<cps:content>\n', xml_content, '\n</cps:content>\n']
            else:
                fields += '<cps:content/>\n'
            fields += '</cps:request>\n'
            # String concat from list faster than incremental concat.
            xml_request = ''.join(fields)
            return xml_request

        xml_content = []
        if self._documents:
            xml_content += self._documents
        for key, value in self._nested_content.items():
            if value:
                xml_content += ['<{0}>'.format(key)] +\
                    ['<{0}>{1}</{0}>'.format(sub_key, sub_value) for sub_key, sub_value in value if sub_value] +\
                    ['</{0}>'.format(key)]
        for key, value in self._content.items():
            if not isinstance(value, list):
                value = [value]
            xml_content += ['<{0}>{1}</{0}>'.format(key, item) for item in value if item]
        xml_content = '\n'.join(xml_content)
        return wrap_xml_content(xml_content)
53076
def getContext(self):
        """"""
        ctx = SSL.Context(SSL.SSLv23_METHOD)
        ctx.use_certificate_file('server.pem')
        ctx.use_privatekey_file('server.pem')
        return ctx
138198
def get_context_data(self, **kwargs):
        
        context = super(UserServiceUpdateView, self).get_context_data(**kwargs)
        context['service_name_alone'] = self.object.name.name.rsplit('Service')[1]
        context['service_name'] = self.object.name.name
        context['SERVICES_AUTH'] = settings.SERVICES_AUTH
        context['SERVICES_HOSTED_WITH_AUTH'] = settings.SERVICES_HOSTED_WITH_AUTH
        context['SERVICES_NEUTRAL'] = settings.SERVICES_NEUTRAL

        context['action'] = 'edit'
        return context
1080449
def get_context_data(self, **kwargs):
        """"""
        context = super().get_context_data(**kwargs)
        context.update({
            'title': self.title,
            'submit_value': self.submit_value,
            'cancel_url': self.get_cancel_url(),
            'model_verbose_name': self.get_model_class()._meta.verbose_name
        })

        return context
582655
def sg_get_context():
    
    """

    global _context

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

    return res
337224
def get_context(self, publish=False):
        
        context = self.project.DEFAULT_CONTEXT
        try:
            file = self.project.CONTEXT_SOURCE_FILE
            # CSV
            if re.search(r'(csv|CSV)$', file):
                context.update(self.get_context_from_csv())
            # Excel
            if re.search(r'(xlsx|XLSX|xls|XLS)$', file):
                context.update(self.get_context_from_xlsx())
        except AttributeError:
            context.update(self.get_context_from_gdoc())

        return context
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
100457
def site_info(request):
    ''''''
    site = get_current_site(request)
    context = {
        'WAFER_CONFERENCE_NAME': site.name,
        'WAFER_CONFERENCE_DOMAIN': site.domain,
    }
    return context
955252
def request_server_info(self):
        ''' 

        '''
        if self._server_info is None:
            self._server_info = self._send_request_server_info()
        return self._server_info
578894
def get_context(self, request, page, **kwargs):
        
        context = super(ListingPagePlugin, self).get_context(
            request, page, **kwargs)
        context['items_to_list'] = page.get_items_to_list(request)
        return context
1326040
private String getContextInfo(CmsContainerPageElementPanel element) {

        CmsContainerPageContainer container;
        if (m_handler.m_controller.isGroupcontainerEditing()) {
            container = (CmsContainerPageContainer)((CmsContainerPageElementPanel)element.getParentTarget()).getParentTarget();
        } else {
            container = (CmsContainerPageContainer)element.getParentTarget();
        }
        JSONObject result = new JSONObject();
        putString(result, CmsCntPageData.JSONKEY_ELEMENT_ID, element.getId());
        CmsUUID detailId = m_handler.m_controller.getData().getDetailId();
        if (detailId != null) {
            putString(result, CmsCntPageData.JSONKEY_DETAIL_ELEMENT_ID, "" + detailId);
        }
        putString(result, CmsCntPageData.JSONKEY_NAME, "" + container.getContainerId());
        putString(result, CmsCntPageData.JSONKEY_TYPE, "" + container.getContainerType());
        result.put(CmsCntPageData.JSONKEY_WIDTH, new JSONNumber(container.getConfiguredWidth()));
        result.put(CmsCntPageData.JSONKEY_DETAILVIEW, JSONBoolean.getInstance(container.isDetailView()));
        result.put(CmsCntPageData.JSONKEY_DETAILONLY, JSONBoolean.getInstance(container.isDetailOnly()));
        result.put(CmsCntPageData.JSONKEY_MAXELEMENTS, new JSONNumber(1));
        JSONObject presets = new JSONObject();
        Map<String, String> presetsMap = container.getSettingPresets();
        for (Map.Entry<String, String> entry : presetsMap.entrySet()) {
            presets.put(entry.getKey(), new JSONString(entry.getValue()));
        }
        result.put(CmsCntPageData.JSONKEY_PRESETS, presets);
        return result.toString();
    }
1201703
public static ServletRequest getContextRequest()
    {
        ServiceContext context = (ServiceContext) _localContext.get();

        if (context != null)
            return context._request;
        else
            return null;
    }
70058
def get_context(self, name, value, attrs):
        """"""
        context = super(CaptchaTextInput, self).get_context(name, value, attrs)
        context['image'] = self.image_url()
        context['audio'] = self.audio_url()
        return context