Create a context object
181216
static final Context context(Element match, int matchIndex, int matchSize, Element element, int elementIndex, int elementSize) {
        return new DefaultContext(match, matchIndex, matchSize, element, elementIndex, elementSize);
    }
265408
def construct_context(self, request):
        
        opts = self.model._meta
        app_label = opts.app_label
        object_name = opts.object_name.lower()
        form = self.construct_form(request)

        media = self.media(form)
        context = {
            'user': request.user,
            'title': '%s %s' % (self.label, opts.verbose_name_plural.lower()),
            'tool': self,
            'opts': opts,
            'app_label': app_label,
            'media': media,
            'form': form,
            'changelist_url': reverse('admin:%s_%s_changelist' % (
                app_label, object_name
            ))
        }

        # Pass along fieldset if sepcififed.
        if hasattr(form, 'fieldsets'):
            admin_form = helpers.AdminForm(form, form.fieldsets, {})
            context['adminform'] = admin_form

        return context
81643
def context_chain(self) -> List['Context']:
        """"""
        contexts = []
        ctx = self  # type: Optional[Context]
        while ctx is not None:
            contexts.append(ctx)
            ctx = ctx.parent

        return contexts
903871
public Object createContext(Object param) throws Exception {

        Class<?>[] params = mConstr != null ? mConstr.getParameterTypes() : new Class[0];
        if (params.length > 1 && MergedClass.InvocationEventObserver.class.equals(params[1])) {
            return mConstr.newInstance(new Object[] {
                new MergingContextFactory(param),
                new MergedClass.InvocationEventObserver() {
                    public void invokedEvent(String caller, String callee, long elapsedTime) { }
                    public long currentTime() { return 0L; }
            }});
        }
        else {
            return mConstr.newInstance(new Object[] {
                new MergingContextFactory(param)});
        }
    }
747617
def new_context(environment, template_name, blocks, vars=None,
                shared=None, globals=None, locals=None):
    """"""
    if vars is None:
        vars = {}
    if shared:
        parent = vars
    else:
        parent = dict(globals or (), **vars)
    if locals:
        # if the parent is shared a copy should be created because
        # we don't want to modify the dict passed
        if shared:
            parent = dict(parent)
        for key, value in iteritems(locals):
            if value is not missing:
                parent[key] = value
    return environment.context_class(environment, parent, template_name,
                                     blocks)
1085492
def InitializeContext(self, args):
    """"""
    if args is None:
      args = rdf_hunts.HuntRunnerArgs()

    context = rdf_hunts.HuntContext(
        create_time=rdfvalue.RDFDatetime.Now(),
        creator=self.token.username,
        duration=args.expiry_time,
        start_time=rdfvalue.RDFDatetime.Now(),
        usage_stats=rdf_stats.ClientResourcesStats())

    return context
427091
def set_context(self, data):
        """"""
        for key in data:
            setattr(self.local_context, key, data[key])
661830
function create(context) {
    return {
        CallExpression(node) {
            if (isFunctionDefine(node)) {
                context.report(node, message);
            }
        }
    };
}
242048
function createContext(req, res, context, done) {
  debug('default createContext - does nothing', context);
  process.nextTick(done.bind(null, null, context));
}
1133527
def init_with_context(self, context):
        
        items = self._visible_models(context['request'])
        apps = {}
        for model, perms in items:
            if not (perms['change'] or perms.get('view', False)):
                continue
            app_label = model._meta.app_label
            if app_label not in apps:
                apps[app_label] = {
                    'title':
                        django_apps.get_app_config(app_label).verbose_name,
                    'url': self._get_admin_app_list_url(model, context),
                    'models': []
                }
            apps[app_label]['models'].append({
                'title': model._meta.verbose_name_plural,
                'url': self._get_admin_change_url(model, context)
            })

        for app in sorted(apps.keys()):
            app_dict = apps[app]
            item = MenuItem(title=app_dict['title'], url=app_dict['url'])
            # sort model list alphabetically
            apps[app]['models'].sort(key=lambda x: x['title'])
            for model_dict in apps[app]['models']:
                item.children.append(MenuItem(**model_dict))
            self.children.append(item)
56534
protected void initContext() {
        context = createContext();
        SmartFoxContext sfsContext = (SmartFoxContext)context;
        sfsContext.setApi(getApi());
        sfsContext.setExtension(this);
    }
1324898
def context(self, identifier=None, meta=None):
        
        return Context(self, identifier=identifier, meta=meta)
171557
def get_context(self, name, value, attrs):
        """"""
        context = {}
        context['widget'] = {
            'name': name,
            'type': 'text',
            'is_hidden': self.is_hidden,
            'required': self.is_required,
            'value': self.format_value(value),
            'attrs': {**self.attrs, **(attrs or {})},
            'template_name': self.template_name,
        }
        return context
1323457
function create(context) {
    return {
        AssignmentExpression(node) {
            if (isRequire(node.left) || isWindowRequire(node.left)) {
                context.report(node, message);
            }
        },

        VariableDeclarator(node) {
            if (isRequire(node.id)) {
                context.report(node, message);
            }
        }
    };
}
423331
function(context, args, stack) {
		var ctx = new Context(args[0], args[1] || context);
		stack.push(ctx);
		return ctx;
	}
782626
async function createContext(projectId, sessionId, contextId, lifespanCount) {
  // [START dialogflow_create_context]
  // Imports the Dialogflow library
  const dialogflow = require('dialogflow');

  // Instantiates clients
  const contextsClient = new dialogflow.ContextsClient();

  const sessionPath = contextsClient.sessionPath(projectId, sessionId);
  const contextPath = contextsClient.contextPath(
    projectId,
    sessionId,
    contextId
  );

  const createContextRequest = {
    parent: sessionPath,
    context: {
      name: contextPath,
      lifespanCount: lifespanCount,
    },
  };

  const responses = await contextsClient.createContext(createContextRequest);
  console.log(`Created ${responses[0].name} context`);
  // [END dialogflow_create_context]
}
315461
function childContext(path, context) {
  const { settings, parserOptions, parserPath } = context
  return {
    settings,
    parserOptions,
    parserPath,
    path,
  }
}