Get all nodes for given app
        :param str app_label: app label
        :rtype: list
976355
def get_app_nodes(self, app_label):
        
        return [node for node in self.graph.nodes if node[0] == app_label]
298075
def find_network_by_label(self, label):
        
        networks = self.list()
        match = [network for network in networks
                if network.label == label]
        if not match:
            raise exc.NetworkNotFound("No network with the label '%s' exists" %
                    label)
        elif len(match) > 1:
            raise exc.NetworkLabelNotUnique("There were %s matches for the label "
                    "'%s'." % (len(match), label))
        return match[0]
621706
def index
      @app_reviews = MnoEnterprise::AppFeedback
      @app_reviews = @app_reviews.limit(params[:limit]) if params[:limit]
      @app_reviews = @app_reviews.skip(params[:offset]) if params[:offset]
      @app_reviews = @app_reviews.order_by(params[:order_by]) if params[:order_by]
      @app_reviews = @app_reviews.where(params[:where]) if params[:where]
      @app_reviews = @app_reviews.all.fetch
      response.headers['X-Total-Count'] = @app_reviews.metadata[:pagination][:count]
    end
719181
def app_model_id(obj):
    
    ct = ContentType.objects.get_for_model(obj)

    return '%s-%s-%s' % (ct.app_label, ct.model, obj.id)
387029
def get_model(app_label, model_name):
    
    try:
        return apps.get_model(app_label, model_name)
    except AppRegistryNotReady:
        if apps.apps_ready and not apps.models_ready:
            # If the models module of the considered app has not been loaded yet,
            # we try to import it manually in order to retrieve the model class.
            # This trick is usefull in order to get the model class during the
            # ``apps.populate()`` call and the execution of related methods of AppConfig
            # instances (eg. ``ready``).

            # Firts, the config of the consideration must be retrieved
            app_config = apps.get_app_config(app_label)
            # Then the models module is manually imported
            import_module('%s.%s' % (app_config.name, MODELS_MODULE_NAME))
            # Finally, tries to return the registered model class
            return apps.get_registered_model(app_label, model_name)
        else:
            raise
1134548
def get_model_names(app_label, models):
    
    return dict(
        (model, get_model_name(app_label, model))
        for model in models
    )
384262
def list_keys(self, label=None):
        
        _filter = utils.NestedDict({})
        if label:
            _filter['sshKeys']['label'] = utils.query_filter(label)

        return self.client['Account'].getSshKeys(filter=_filter.to_dict())
1161906
def get_label_names(ctx):
    """"""
    labels = [
        label
        for label in ctx.__dict__
        if not label.startswith("_")
        and label
        not in [
            "children",
            "exception",
            "invokingState",
            "parentCtx",
            "parser",
            "start",
            "stop",
        ]
    ]
    return labels
1070743
def all_synonyms(self, include_label=False):
        
        syns = []
        for n in self.nodes():
            syns = syns + self.synonyms(n, include_label=include_label)
        return syns
284065
def get_label_fields(self):
        
        present_label_fields = []
        for field in ann_label_fields:
            if getattr(self, field) is not None:
                present_label_fields.append(field)

        return present_label_fields
1103167
def get_apps(self):
        
        ena_apps = {}

        res = self._make_ocs_request('GET', self.OCS_SERVICE_CLOUD, 'apps')
        if res.status_code != 200:
            raise HTTPResponseError(res)
        tree = ET.fromstring(res.content)
        self._check_ocs_status(tree)
        # <data><apps><element>files</element><element>activity</element> ...
        for el in tree.findall('data/apps/element'):
            ena_apps[el.text] = False

        res = self._make_ocs_request('GET', self.OCS_SERVICE_CLOUD,
                                     'apps?filter=enabled')
        if res.status_code != 200:
            raise HTTPResponseError(res)
        tree = ET.fromstring(res.content)
        self._check_ocs_status(tree)
        for el in tree.findall('data/apps/element'):
            ena_apps[el.text] = True

        return ena_apps
799180
def get_labels(obj):
        
        if Clustering.is_pyclustering_instance(obj.model):
            return obj._labels_from_pyclusters
        else:
            return obj.model.labels_
1127899
def get_fixture_node(self, app_label, fixture_prefix):
        
        app_nodes = self.get_app_nodes(app_label=app_label)
        nodes = [
            node for node in app_nodes if node[1].startswith(fixture_prefix)
            ]

        if len(nodes) > 1:
            raise MultipleFixturesFound(
                "The following fixtures with prefix '%s' are found in app '%s'"
                ": %s" % (
                    fixture_prefix, app_label, ', '.join(
                        [node[1] for node in nodes]
                    )
                )
            )
        elif len(nodes) == 0:
            raise FixtureNotFound("Fixture with prefix '%s' not found in app "
                                  "'%s'" % (fixture_prefix, app_label))
        return nodes
52619
def show(cls, app_id):
        
        conn = Qubole.agent()
        return conn.get(cls.element_path(app_id))
1027088
def get_app_voice(self, item):
        
        if item.get('name', None) is None:
            raise ImproperlyConfigured('App menu voices must have a name key')
        if self.check_apps_permission([item.get('name', None)]):
            children = []
            if item.get('models', None) is None:
                for name, model in self.apps_dict[item.get('name')]['models'].items(): # noqa
                    children.append({
                        'type': 'model',
                        'label': model.get('name', ''),
                        'url': model.get('admin_url', '')
                    })
            else:
                for model_item in item.get('models', []):
                    voice = self.get_model_voice(item.get('name'), model_item)
                    if voice:
                        children.append(voice)

            return {
                'type': 'app',
                'label': item.get('label', ''),
                'icon': item.get('icon', None),
                'children': children
            }
        return None
1259350
def get_by_label(self, label):
        
        return next((x for x in self if x.label == label), None)
489074
def get_models(app_labels):
    

    # These models are not to be output, e.g. because they can be generated automatically
    # TODO: This should be "appname.modelname" string
    EXCLUDED_MODELS = (ContentType, )

    models = []

    # If no app labels are given, return all
    if not app_labels:
        for app in apps.get_app_configs():
            models += [m for m in apps.get_app_config(app.label).get_models()
                       if m not in EXCLUDED_MODELS]
        return models

    # Get all relevant apps
    for app_label in app_labels:
        # If a specific model is mentioned, get only that model
        if "." in app_label:
            app_label, model_name = app_label.split(".", 1)
            models.append(apps.get_model(app_label, model_name))
        # Get all models for a given app
        else:
            models += [m for m in apps.get_app_config(app_label).get_models()
                       if m not in EXCLUDED_MODELS]

    return models