Returns the context data to provide to the template.
559814
def get_context_data(self, **kwargs):
        
        context = super().get_context_data(**kwargs)
        context['topic'] = self.object
        context['forum'] = self.object.forum
        return context
696530
def get_context(template, line, num_lines=5, marker=None):
    '''
    
    '''
    template_lines = template.splitlines()
    num_template_lines = len(template_lines)

    # In test mode, a single line template would return a crazy line number like,
    # 357. Do this sanity check and if the given line is obviously wrong, just
    # return the entire template
    if line > num_template_lines:
        return template

    context_start = max(0, line - num_lines - 1)  # subt 1 for 0-based indexing
    context_end = min(num_template_lines, line + num_lines)
    error_line_in_context = line - context_start - 1  # subtr 1 for 0-based idx

    buf = []
    if context_start > 0:
        buf.append('[...]')
        error_line_in_context += 1

    buf.extend(template_lines[context_start:context_end])

    if context_end < num_template_lines:
        buf.append('[...]')

    if marker:
        buf[error_line_in_context] += marker

    return '---\n{0}\n---'.format('\n'.join(buf))
1125253
public Map<String, Object> getContextData() {
        if (ivContextData == null) {
            ivContextData = new HashMap<String, Object>();

            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                Tr.debug(tc, "getContextData: created empty");
        }

        return ivContextData;
    }
222204
public function getContext(TemplateContextInterface $context = null)
    {
        $context = new TemplateContext($context);
        $context->setData($this->getData());
        $context->setParameters($this->getParameters());

        return $context;
    }
1006232
def get_context_template():
    
    import random
    return {
        'SITE_ID': 1,
        'SECRET_KEY': ''.join(
            [random.SystemRandom().choice('abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)') for i in range(50)]),
        'DATA_DIR': os.path.join(os.environ['PRODUCT_DIR'], '__data__'),
    }
704805
def get_context_data(self, **kwargs):
        """"""
        r = get_r()
        category = kwargs.pop('category', None)
        data = super(AggregateDetailView, self).get_context_data(**kwargs)

        if category:
            slug_set =   r._category_slugs(category)
        else:
            slug_set = set(kwargs['slugs'].split('+'))

        data['granularities'] = list(r._granularities())
        data['slugs'] = slug_set
        data['category'] = category
        return data
1229300
def get_context(self):
        
        ctx = self._obj.get_context()
        return _ContextProxy(ctx, self._factory)
705295
def get_context_data(self, **kwargs):
        """"""
        context = super(ScheduleXmlView, self).get_context_data(**kwargs)
        if self.request.GET.get('render_description', None) == '1':
            context['render_description'] = True
        else:
            context['render_description'] = False
        return context
31072
def get_context_data(self,**kwargs):
        '''  '''
        event = Event.objects.filter(id=self.kwargs.get('event_id')).first()
        if self.kwargs.get('event_id') and not self.object.appliesToEvent(event):
            raise Http404(_('Invalid event.'))

        # Use the most current event if nothing has been specified.
        if not event:
            event = self.object.currentEvent

        context = {
            'guestList': self.object,
            'event': event,
            'names': self.object.getListForEvent(event),
        }
        context.update(kwargs)
        return super(GuestListView,self).get_context_data(**context)
242412
def get_context_data(self, **kwargs):
        """"""
        context = super(ReportMixin, self).get_context_data(**kwargs)

        form = self.get_form()
        if form.is_valid():
            data = form.cleaned_data
            start, end = form.save()
            entryQ = self.get_entry_query(start, end, data)
            trunc = data['trunc']
            if entryQ:
                vals = ('pk', 'activity', 'project', 'project__name',
                        'project__status', 'project__type__label')
                entries = Entry.objects.date_trunc(
                    trunc, extra_values=vals).filter(entryQ)
            else:
                entries = Entry.objects.none()

            end = end - relativedelta(days=1)
            date_headers = generate_dates(start, end, by=trunc)
            context.update({
                'from_date': start,
                'to_date': end,
                'date_headers': date_headers,
                'entries': entries,
                'filter_form': form,
                'trunc': trunc,
            })
        else:
            context.update({
                'from_date': None,
                'to_date': None,
                'date_headers': [],
                'entries': Entry.objects.none(),
                'filter_form': form,
                'trunc': '',
            })

        return context
1054826
def get_context_data(self, **kwargs):
        
        for key in self.get_form_class_keys():
            kwargs['{}_form'.format(key)] = self.get_form(key)
        return super(FormMixin, self).get_context_data(**kwargs)
650349
def get_context_data(self, **kwargs):
        
        #noinspection PyUnresolvedReferences
        query_str           = self.request.GET.get('q', None)
        queryset            = kwargs.pop('object_list', self.object_list)
        context_object_name = self.get_context_object_name(queryset)

        # Build the context dictionary.
        context = {
            'ordering':     self.get_ordering(),
            'query_string': query_str,
            'is_searching': bool(query_str),
        }

        # Add extra variables to context for non-AJAX requests.
        #noinspection PyUnresolvedReferences
        if not self.request.is_ajax() or kwargs.get('force_search', False):
            context.update({
                'search_form':  self.get_search_form(),
                'popular_tags': self.model.popular_tags()
            })

        if context_object_name is not None:
            context[context_object_name] = queryset

        # Update context with any additional keyword arguments.
        context.update(kwargs)

        return super(IndexView, self).get_context_data(**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
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
753144
def get_context_data(self, **kwargs):
        '''
        
        '''

        # Call the base implementation first to get a context
        context = super(GenList, self).get_context_data(**kwargs)
        # Update general context with the stuff we already calculated
        context.update(self.__context)

        # Initialize with our timestamp
        context['now'] = epochdate(time.time())
        context['profile'] = self.profile

        # Check vtable
        context['vtable'] = getattr(self, 'vtable', False)

        # Export to excel
        context['export_excel'] = getattr(self, 'export_excel', True)
        context['export_name'] = getattr(self, 'export_name', 'list')

        # Check ngincludes
        context['ngincludes'] = getattr(self, 'ngincludes', {})
        if 'table' not in context['ngincludes'].keys():
            context['ngincludes']['table'] = "{}codenerix/partials/table.html".format(settings.STATIC_URL)

        # Check linkadd
        context['linkadd'] = getattr(self, 'linkadd', self.auth_permission('add') or getattr(self, 'public', False))

        # Check linkedit
        context['linkedit'] = getattr(self, 'linkedit', self.auth_permission('change') or getattr(self, 'public', False))

        # Check showdetails
        context['show_details'] = getattr(self, 'show_details', False)

        # Check showmodal
        context['show_modal'] = getattr(self, 'show_modal', False)

        # Set search filter button
        context['search_filter_button'] = getattr(self, 'search_filter_button', False)

        # Get base template
        if not self.json_worker:
            template_base = getattr(self, 'template_base', 'base/base')
            template_base_ext = getattr(self, 'template_base_ext', 'html')
            context['template_base'] = get_template(template_base, self.user, self.language, extension=template_base_ext)

        # Try to convert object_id to a numeric id
        object_id = kwargs.get('object_id', None)
        try:
            object_id = int(object_id)
        except Exception:
            pass

        # Python 2 VS Python 3 compatibility
        try:
            unicode('codenerix')
            unicodetest = unicode
        except NameError:
            unicodetest = str

        if isinstance(object_id, str) or isinstance(object_id, unicodetest):
            # If object_id is a string, we have a name not an object
            context['object_name'] = object_id
            object_obj = None
        else:
            # If is not an string
            if object_id:
                # If we got one, load the object
                obj = context['obj']
                object_obj = get_object_or_404(obj, pk=object_id)
            else:
                # There is no object
                object_obj = None
            context['object_obj'] = object_obj

        # Attach extra_context
        context.update(self.extra_context)
        # Return new context
        return context
769562
public ContextData contextData(Object[] swaggerMethodArguments) {
        Object firstArg = swaggerMethodArguments != null && swaggerMethodArguments.length > 0 ? swaggerMethodArguments[0] : null;
        if (firstArg instanceof ContextData) {
            return (ContextData) firstArg;
        } else {
            return ContextData.NONE;
        }
    }
852898
def get_context_data(self, **kwargs):
        """"""
        
        context = super(BreedingList, self).get_context_data(**kwargs)
        context['breeding_type'] = "Active" 
        return context