Dictionary of interventions in /scenario/interventions/vectorPop section
352284
def interventions(self):
        
        interventions = {}
        if self.et is None:
            return interventions
        for intervention in self.et.findall("intervention"):
            interventions[intervention.attrib['name']] = VectorPopIntervention(intervention)
        return interventions
1100653
function () {
    var packages = [
      'ember-cli-autoprefixer',
      'ember-cli-blanket',
      'ember-cli-sass',
      'ember-cpm',
      'ember-feature-flags',
      'ember-metrics',
      'ember-moment',
      'ember-responsive',
      'ember-route-action-helper',
      'ember-suave',
      'ember-truth-helpers'
    ];

    var updatePrompt = {
      type: 'confirm',
      name: 'answer',
      choices: [
        { key: 'y', name: 'Yes', value: 'yes' },
        { key: 'n', name: 'No', value: 'no' }
      ]
    };

    var prompts = [
      extend({ message: 'Would you like to enhance your ember-cli-opinionated setup?', packages: packages }, updatePrompt),
      // extend({ message: 'Organizing Your App Into Pods', packages: ['ember-cli-sass-pods'] }, updatePrompt),
      extend({ message: 'Analytics/Reports', packages: ['ember-e3'] }, updatePrompt),
      extend({ message: 'Testing', packages: ['ember-cli-mirage', 'ember-sinon-qunit'] }, updatePrompt),
      // extend({ message: 'Internationalization (i18n)', packages: ['ember-intl'] }, updatePrompt),
      extend({ message: 'Mobile Touch', packages: ['ember-gestures'] }, updatePrompt),
      extend({ message: 'Material Design', packages: ['ember-paper'] }, updatePrompt),
      extend({ message: 'Animations', packages: ['liquid-fire'] }, updatePrompt)
    ];

    return this.promptUserForOpinions(packages, prompts);
  }
99852
def api_orgas(request, key=None, hproPk=None):
    """"""

    if not check_api_key(request, key, hproPk):
        return HttpResponseForbidden

    list_orgas = []

    if settings.PIAPI_STANDALONE:
        list_orgas = [{'id': -1, 'name': 'EBU', 'codops': 'ZZEBU'},
                      {'id': -2, 'name': 'RTS', 'codops': 'CHRTS'},
                      {'id': -3, 'name': 'BBC', 'codops': 'GBEBU'},
                      {'id': -4, 'name': 'CNN', 'codops': 'USCNN'}]

    else:
        from organizations.models import Organization

        (_, _, hproject) = getPlugItObject(hproPk)

        if hproject and hproject.plugItLimitOrgaJoinable:
            orgas = hproject.plugItOrgaJoinable.order_by('name').all()
        else:
            orgas = Organization.objects.order_by('name').all()

        list_orgas = [{'id': orga.pk, 'name': orga.name, 'codops': orga.ebu_codops} for orga in orgas]

    retour = {'data': list_orgas}

    return HttpResponse(json.dumps(retour), content_type="application/json")
634270
function getVerbHelp(verb, output) {
    let targets = [];
    let options = {
        head: `Available resources for ${chalk.bold(verb)}:`,
        table: []
    };

    // special verbs

    let sections = [];

    switch (verb) {
    case "query":
        output.write(chalk.cyan.bold("luis query --query <querytext> [--appId | --endpoint | --nologging | --region | --spellCheck | --staging | --subscriptionKey | --timezoneOffset | --timing |  --verbose]\n\n"))
        options.table.push([chalk.cyan.bold("--query <query>"), "Query to analyze with LUIS prediction."]);
        options.table.push([chalk.cyan.bold("--endpoint <endpointUrl>"), "Endpoint to use for query like https://westus.api.cognitive.microsoft.com/luis/v2.0/apps, overrides region."]);
        options.table.push([chalk.cyan.bold("--nologging"), "Turn off query logging in LUIS."]);
        options.table.push([chalk.cyan.bold("--spellCheck <key>"), "Check spelling using your Bing spelling key."]);
        options.table.push([chalk.cyan.bold("--staging"), "Use the staging environtment rather than production."]);
        options.table.push([chalk.cyan.bold("--timezoneOffset <minutes>"), "Specify the timezone offset in minutes used for resolving data time."]);
        options.table.push([chalk.cyan.bold("--timing [iterations]"), "Perform timings on query, default is 5 iterations."]);
        options.table.push([chalk.cyan.bold("--verbose"), "Include scores for all intents."]);
        sections.push(options);
        sections.push(configSection);
        sections.push(globalArgs);
        return sections;

    case "set":
        output.write(chalk.cyan.bold("luis set <appIdOrName> [--appId|--versionId|--authoringKey|--endpoint] <value>\n\n"))
        options.table.push([chalk.cyan.bold("<appIdOrName>"), "change the active application by looking it up by name or id"]);
        options.table.push([chalk.cyan.bold("--appId <appId>"), "change the active application id "]);
        options.table.push([chalk.cyan.bold("--versionId <version>"), "change the active version id "]);
        options.table.push([chalk.cyan.bold("--authoringKey <authoringKey>"), "change the active authoringKey◘"]);
        options.table.push([chalk.cyan.bold("--endpoint <endpointUrl>"), "change the active endpointBasePath url"]);
        sections.push(options);
        sections.push(configSection);
        sections.push(globalArgs);
        return sections;
    }

    for (let iOperation in operations) {
        let operation = operations[iOperation];
        if (operation.methodAlias == verb) {
            let target = operation.target[0];
            if (targets.indexOf(target) < 0) {
                targets.push(target);
            }
        }
    }


    if (targets.length == 0)
        return getGeneralHelpContents(output);

    targets.sort();
    for (let target of targets) {
        options.table.push([chalk.cyan.bold(target), '']);
    }
    sections.push(options);
    sections.push(configSection);
    sections.push(globalArgs);
    return sections;
}
14884
def effects_impact_plot(self):
        

        # Put keys in a more logical order
        keys = [ 'MODIFIER', 'LOW', 'MODERATE', 'HIGH' ]

        # Make nicer label names
        pkeys = OrderedDict()
        for k in keys:
            pkeys[k] = {'name': k.title() }

        # Config for the plot
        pconfig = {
            'id': 'snpeff_variant_effects_impact',
            'title': 'SnpEff: Counts by Effects Impact',
            'ylab': '# Reads',
            'logswitch': True
        }

        return bargraph.plot(self.snpeff_data, pkeys, pconfig)
1232159
function setVocabIds(index, pkg, callback) {
	if(!pkg.tags) return callback();

	if( index == pkg.tags.length ) {
		callback();
	} else {
		getVocabId(pkg.tags[index].vocabulary_id, function(id) {
			pkg.tags[index].vocabulary_id = id;
			index++;
			setVocabIds(index, pkg, callback);
		});
	}
}
936022
def get_vector(self):
        """"""
        vec = {}
        for dim in ['forbidden', 'required', 'permitted']:
            if self.survey[dim] is None:
                continue
            dim_vec = map(lambda x: (x['tag'], x['answer']), 
                          self.survey[dim])
            vec[dim] = dict(dim_vec)
        return vec
1025759
def _get_scenarios(network_id, include_data, user_id, scenario_ids=None):
    
    scen_qry = db.DBSession.query(Scenario).filter(
                    Scenario.network_id == network_id).options(
                        noload('network')).filter(
                        Scenario.status == 'A')

    if scenario_ids:
        logging.info("Filtering by scenario_ids %s",scenario_ids)
        scen_qry = scen_qry.filter(Scenario.id.in_(scenario_ids))
    extras = {'resourcescenarios': [], 'resourcegroupitems': []}
    scens = [JSONObject(s,extras=extras) for s in db.DBSession.execute(scen_qry.statement).fetchall()]

    all_resource_group_items = _get_all_group_items(network_id)

    if include_data == 'Y' or include_data == True:
        all_rs = _get_all_resourcescenarios(network_id, user_id)
        metadata = _get_metadata(network_id, user_id)

    for s in scens:
        s.resourcegroupitems = all_resource_group_items.get(s.id, [])

        if include_data == 'Y' or include_data == True:
            s.resourcescenarios  = all_rs.get(s.id, [])

            for rs in s.resourcescenarios:
                rs.dataset.metadata = metadata.get(rs.dataset_id, {})

    return scens
968989
def item_gemeente_adapter(obj, request):
    
    return {
        'id': obj.id,
        'niscode': obj.niscode,
        'naam': obj.naam,
        'centroid': obj.centroid,
        'bounding_box': obj.bounding_box,
        'metadata': {
            'begin_tijd': obj.metadata.begin_tijd,
            'begin_datum': obj.metadata.begin_datum,
            'begin_bewerking': {
                'id': obj.metadata.begin_bewerking.id,
                'naam': obj.metadata.begin_bewerking.naam,
                'definitie': obj.metadata.begin_bewerking.definitie
            },
            'begin_organisatie': {
                'id': obj.metadata.begin_organisatie.id,
                'naam': obj.metadata.begin_organisatie.naam,
                'definitie': obj.metadata.begin_organisatie.definitie
            }
        }
    }
924656
def dotopdict(self, dict_):
        
        mlookup = {'get':'GET', 'post':'POST'}
        def rearrange(path, method_dict, method):
            oid = method_dict['operationId']
            self._paths[oid] = path
            method_dict['nickname'] = oid
            method_dict['method'] = mlookup[method]

        paths = dict_['paths']
        for path, path_dict in paths.items():
            if self.path_prefix and self.path_prefix not in path:
                continue
            path_dict['operations'] = []
            for method, method_dict in sorted(path_dict.items()):
                if method == 'operations':
                    continue
                rearrange(path, method_dict, method)
                #print(self.operation(method_dict))
                path_dict['operations'].append(method_dict)
            path_dict['path'] = path

        def setp(v, lenp=len(self.path_prefix)):
            v['path'] = v['path'][lenp:]
            return v

        dict_['apis'] = []
        for tag_dict in dict_['tags']:
            path = '/' + tag_dict['name']
            d = {'path':path,
                 'description':tag_dict['description'],
                 'class_json':{
                     'docstring':tag_dict['description'],
                     'resourcePath':path,
                     'apis':[setp(v) for k, v in paths.items()
                             if k.startswith(self.path_prefix + path)]},
            }
            dict_['apis'].append(d)

        # make sure this is run first so we don't get key errors
        self._swagger(dict_['swagger'])
        self._info(dict_['info'])
        self._definitions(dict_['definitions'])

        return dict_
152114
function context(phase, stage, mode, local) {
        return {phase: phase, stage: stage, mode: mode, local: local};
    }
290157
def item_adrespositie_adapter(obj, request):
    
    return {
        'id': obj.id,
        'herkomst': {
            'id': obj.herkomst.id,
            'naam': obj.herkomst.naam,
            'definitie': obj.herkomst.definitie
        },
        'geometrie': obj.geometrie,
        'aard': {
            'id': obj.aard.id,
            'naam': obj.aard.naam,
            'definitie': obj.aard.definitie
        },
        'metadata': {
            'begin_tijd': obj.metadata.begin_tijd,
            'begin_datum': obj.metadata.begin_datum,
            'begin_bewerking': {
                'id': obj.metadata.begin_bewerking.id,
                'naam': obj.metadata.begin_bewerking.naam,
                'definitie': obj.metadata.begin_bewerking.definitie
            },
            'begin_organisatie': {
                'id': obj.metadata.begin_organisatie.id,
                'naam': obj.metadata.begin_organisatie.naam,
                'definitie': obj.metadata.begin_organisatie.definitie
            }
        }
    }
685734
def p_contextualize_items(self, t):
        """"""
        if len(t) == 3:
            t[0] = t[1]
            t[0].append(t[2])
        elif t[1]:
            t[0] = [t[1]]
        else:
            t[0] = []
1218166
private void addVector(VectorLayer layer, int ruleIndex, String title) {
		HLayout layout = new HLayout(WidgetLayout.marginSmall);
		layout.setHeight(WidgetLayout.legendVectorRowHeight);
		UrlBuilder urlBuilder = new UrlBuilder(Geomajas.getDispatcherUrl());
		urlBuilder.addPath("legendgraphic");
		urlBuilder.addPath(layer.getServerLayerId());
		urlBuilder.addPath(layer.getLayerInfo().getNamedStyleInfo().getName());
		urlBuilder.addPath(ruleIndex + ".png");
		Img icon = new Img(urlBuilder.toString(), WidgetLayout.legendRasterIconWidth,
				WidgetLayout.legendRasterIconHeight);
		icon.setLayoutAlign(Alignment.LEFT);
		layout.addMember(icon);
		Label label = new Label(title);
		label.setWrap(false);
		label.setLayoutAlign(Alignment.LEFT);
		layout.addMember(label);
		addMember(layout);
	}
1117145
def get(self):
        """"""
        options = {}
        for x in [self.axes, self.graphics, self.layout]:
            for k, v in list(x.get().items()):
                options[k] = v

        return options
1181195
def get_notify_observers_kwargs(self):
        
        return {'x_new': self._linear.adj_op(self._x_new),
                'z_new': self._z_new, 'idx': self.idx}
504168
def interpret_defintion_annotations(potential_definition_inds, aux_note):
    

    fs = None
    custom_labels = []

    if len(potential_definition_inds) > 0:
        i = 0
        while i<len(potential_definition_inds):
            if aux_note[i].startswith('## '):
                if not fs:
                    search_fs = rx_fs.findall(aux_note[i])
                    if search_fs:
                        fs = float(search_fs[0])
                        if round(fs, 8) == float(int(fs)):
                            fs = int(fs)
                        i += 1
                        continue
                if aux_note[i] == '## annotation type definitions':
                    i += 1
                    while aux_note[i] != '## end of definitions':
                        label_store, symbol, description = rx_custom_label.findall(aux_note[i])[0]
                        custom_labels.append((int(label_store), symbol, description))
                        i += 1
                    i += 1
            else:
                i += 1

    if not custom_labels:
        custom_labels = None

    return fs, custom_labels