Includes the Gauge slugs and data in the context.
481955
def get_context_data(self, **kwargs):
        """"""
        data = super(GaugesView, self).get_context_data(**kwargs)
        data.update({'gauges': get_r().gauge_slugs()})
        return data
521245
function context(data, callback) {
    this.__data     = data;
    this.__callback = callback;
    this.__result   = [''];
    this.__current  = 0;
    this.__waiting  = 1;
    this.__contents = -1;
}
1116370
def get_context_data(self, **kwargs):
        """"""
        
        context = super(StrainList, self).get_context_data(**kwargs)
        context['strain_list_alive'] = Strain.objects.filter(animal__Alive=True).annotate(alive=Count('animal'))
        context['cages'] = Animal.objects.filter(Alive=True).values("Cage")        
        return context
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
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
535365
def add_namespace_statistics(self, namespace, offset, data_points,
                                 byte_count):
        """"""
        query = 'UPDATE gauged_statistics ' \
            'SET data_points = data_points + %s,' \
            'byte_count = byte_count + %s WHERE namespace = %s ' \
            'AND "offset" = %s; INSERT INTO gauged_statistics ' \
            'SELECT %s, %s, %s, %s WHERE NOT EXISTS (' \
            'SELECT 1 FROM gauged_statistics WHERE namespace = %s' \
            'AND "offset" = %s)'
        self.cursor.execute(query, (data_points, byte_count, namespace,
                                    offset, namespace, offset, data_points,
                                    byte_count, namespace, offset))
472231
def collect(self):
        """"""
        def traverse(d, metric_name=''):
            """
            Traverse the given nested dict using depth-first search.

            If a value is reached it will be published with a metric name
            consisting of the hierarchically concatenated keys
            of its branch.
            """
            for key, value in d.iteritems():
                if isinstance(value, dict):
                    if metric_name == '':
                        metric_name_next = key
                    else:
                        metric_name_next = metric_name + '.' + key
                    traverse(value, metric_name_next)
                else:
                    metric_name_finished = metric_name + '.' + key
                    self.publish_gauge(
                        name=metric_name_finished,
                        value=value,
                        precision=1
                    )

        md_state = self._parse_mdstat()

        traverse(md_state, '')
180143
def get_context_files(data):
    
    ref_file = dd.get_ref_file(data)
    all_files = []
    for ext in [".bed.gz"]:
        all_files += sorted(glob.glob(os.path.normpath(os.path.join(os.path.dirname(ref_file), os.pardir,
                                                                    "coverage", "problem_regions", "*",
                                                                    "*%s" % ext))))
    return sorted(all_files)
1340186
def get_context_data(self, **kwargs):
        ''''''
        context = super(VeterinaryHome, self).get_context_data(**kwargs)
        context['medical_issues'] = MedicalIssue.objects.all()
        context['medical_conditions'] = MedicalCondition.objects.all()
        context['medical_treatments'] = MedicalTreatment.objects.all()               
        return context
797772
public static void putSpanContextAttachments(MeasureMap measureMap, SpanContext spanContext) {
    checkNotNull(measureMap, "measureMap");
    checkNotNull(spanContext, "spanContext");
    measureMap.putAttachment(
        ATTACHMENT_KEY_SPAN_CONTEXT, AttachmentValueSpanContext.create(spanContext));
  }
787612
def get_context_data(self):
        
        self.get_context()
        self.context_data.update(self.get_extra_context())
        return self.context_data
392767
def context_import(zap_helper, file_path):
    """"""
    with zap_error_handler():
        result = zap_helper.zap.context.import_context(file_path)

        if not result.isdigit():
            raise ZAPError('Importing context from file failed: {}'.format(result))

    console.info('Imported context from {}'.format(file_path))
1037932
def generate_matching_datasets(self, data_slug):
        
        matching_hubs = VERTICAL_HUB_MAP[data_slug]['hubs']
        return Dataset.objects.filter(hub_slug__in=matching_hubs)
302078
def gauge(self, stats, value):
        
        self.update_stats(stats, value, self.SC_GAUGE)
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']))
285203
def get_context_data(self, **kwargs):
        
        context = super().get_context_data(**kwargs)
        context['forum_url'] = self.get_forum_url()
        return context
1219202
function pushContext(data) {
                        
                        // Some data is not needed on subchildren
                        if (depth === 0) {
                            data.timestamp = Date.now() - responseEndTime;
                            data.loadingStep = phantomas.currentStep || '';
                        }

                        // Some data is not needed on subchildren
                        if (depth > 0) {
                            if (data.backtrace) {
                                delete data.backtrace;
                            }
                            if (data.resultsNumber) {
                                delete data.resultsNumber;
                            }
                        }

                        currentContext.addChild(data);
                    }