:type context: dict
339832
def _update_indicators(self, context):
        
        model = self._model
        self._vertical_indicator.set_height(model.height + 1)
        self._vertical_indicator.set_width(1)
        self._horizontal_indicator.set_width(model.width + 1)
        self._horizontal_indicator.set_height(1)

        show_indicators = context['show_indicators']

        self._vertical_indicator.set_visible(model.x_index is not None and show_indicators)
        self._horizontal_indicator.set_visible(model.y_index is not None and show_indicators)

        if model.x_index is not None and show_indicators:
            self._vertical_indicator.set_x(model.x_index)

        if model.y_index is not None and show_indicators:
            self._horizontal_indicator.set_y(model.y_index)
169077
def context(self):
        """"""
        stats = status_codes_by_date_stats()

        attacks_data = [{
            'type': 'line',
            'zIndex': 9,
            'name': _('Attacks'),
            'data': [(v[0], v[1]['attacks'])
                     for v in stats]
        }]

        codes_data = [{
            'zIndex': 4,
            'name': '2xx',
            'data': [(v[0], v[1][200]) for v in stats]
        }, {
            'zIndex': 5,
            'name': '3xx',
            'data': [(v[0], v[1][300]) for v in stats]
        }, {
            'zIndex': 6,
            'name': '4xx',
            'data': [(v[0], v[1][400]) for v in stats]
        }, {
            'zIndex': 8,
            'name': '5xx',
            'data': [(v[0], v[1][500]) for v in stats]
        }]

        return {'generic_chart': json.dumps(status_codes_by_date_chart()),
                'attacks_data': json.dumps(attacks_data),
                'codes_data': json.dumps(codes_data)}
837041
def get_context(self):
        "  "
        return {
                'content_type_name' : str(self.name),
                'content_type_verbose_name' : self.verbose_name,
                'content_type_verbose_name_plural' : self.verbose_name_plural,
                'object' : self.obj,
                'box' : self,
        }
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
787612
def get_context_data(self):
        
        self.get_context()
        self.context_data.update(self.get_extra_context())
        return self.context_data
515942
def get_context(name, doc):
    
    name = inflection.underscore(name)
    return {
        'name': name,
        'doc': doc or name
    }
521214
def get_context_data(self, **kwargs):
        
        context = super(BaseEntrySearch, self).get_context_data(**kwargs)
        context.update({'error': self.error, 'pattern': self.pattern})
        return context
291513
def patch_context(self, context):
        
        context.__class__ = PatchedContext
        # Simply setting __class__ directly doesn't work
        # because behave.runner.Context.__setattr__ is implemented wrongly.
        object.__setattr__(context, '__class__', PatchedContext)
541681
def get_context_data(self, **kwargs):
        
        context = {}
        if 'forms' not in kwargs:
            context['forms'] = self.get_forms()
        else:
            context['forms'] = kwargs['forms']
        return context
1220269
def context(self, mapping_class=DotDictWithAcquisition):
        """"""
        config = None
        try:
            config = self.get_config(mapping_class=mapping_class)
            yield config
        finally:
            if config:
                self._walk_and_close(config)
175249
def context(self, size, placeholder=None, scope=None):
        """"""
        return self.leftcontext(size, placeholder,scope) + [self] + self.rightcontext(size, placeholder,scope)
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
13825
def context_class(self):
        
        if 'context_class' not in self._cached_values:
            context_cls_name = getattr(self.settings, 'CONTEXT_CLASS', '')
            if context_cls_name:
                context_class = import_object(context_cls_name)
            else:
                context_class = Context
            self._cached_values['context_class'] = context_class
        return self._cached_values['context_class']
1369321
def _as_in_context(data, ctx):
    """"""
    if isinstance(data, nd.NDArray):
        return data.as_in_context(ctx)
    elif isinstance(data, (list, tuple)):
        return [_as_in_context(d, ctx) for d in data]
    return data
1368606
def context_lookup(self, vars):
        
        while isinstance(vars, IscmExpr):
            vars = vars.resolve(self.context)
        #
        for (k,v) in vars.items():
            if isinstance(v, IscmExpr):
                vars[k] = v.resolve(self.context)
        return vars
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
775885
def get_context_data(self, **kwargs):
        """"""
        context = super().get_context_data(**kwargs)
        context.update({
            'title': self.get_title(),
            'ajax_url': self.get_ajax_url(),
            'download_url': self.get_download_url(),
            'create_url': self.get_create_url(),
        })
        return context