Return an iterable of models.
768593
def get_configs(self):
        
        self.bots.check_models_ready()
        for config in self.configs.values():
            yield config
381332
def get_models(self):
        
        try:
            rels = self.rels_ext.content
        except RequestFailed:
            # if rels-ext can't be retrieved, confirm this object does not have a RELS-EXT
            # (in which case, it does not have any content models)
            if "RELS-EXT" not in self.ds_list.keys():
                return []
            else:
                raise

        return list(rels.objects(self.uriref, modelns.hasModel))
744793
def _get_models(self, app):
        
        try:
            app_models = app.get_models()
            appmods = []
            for model in app_models:
                appmods.append(model)
        except Exception as e:
            self.err(e)
            return
        return appmods
1118861
private Pair<Map<String, Model>, Map<String, Set<String>>> fetchModels() {
    Map<String, Model> all_models = null;
    Map<String, Set<String>> all_models_cols = null;

    if (this.find_compatible_models) {
      // caches for this request
      all_models = (new Models()).fetchAll();
      all_models_cols = new TreeMap<String, Set<String>>();

      for (Map.Entry<String, Model> entry : all_models.entrySet()) {
        all_models_cols.put(entry.getKey(), new TreeSet<String>(Arrays.asList(entry.getValue()._names)));
      }
    }
    return new Pair<Map<String, Model>, Map<String, Set<String>>>(all_models, all_models_cols);
  }
864660
def models(self):
        
        app = get_app(self.__class__.__module__.split('.')[-2])
        return get_models(app)
832534
def _get_model_nodes(self, model):
        
        nodes = [(name, node) for name, node in model._nodes.items()
                if node._is_auto_created is False]
        nodes.sort(key=lambda n: n[0])
        return nodes
416952
def bind_fields_to_model_cls(cls, model_fields):
        """"""
        return dict(
            (field.name, field.bind_model_cls(cls)) for field in model_fields)
1027039
def get_models(self, model, page=None):
        
        if page is not None:
            return self._store.find_all(self._get_model_class(model), params={'page': int(page)})
        else:
            return self._store.find_all(self._get_model_class(model))
663920
def list_models(self):
        
        try:
            count = self.es.count(index=self.index_name,
                                  doc_type=self.DOC_TYPE, q='*')['count']
            from_ = 0
            while from_ < count:
                ret = self.es.search(index=self.index_name,
                                     doc_type=self.DOC_TYPE, q='*',
                                     size=self.BATCH_SIZE, from_=from_,
                                     _source=self.PACKAGE_FIELDS)
                for hit in ret.get('hits', {}).get('hits', []):
                    yield hit['_source']['id']
                from_ += self.BATCH_SIZE
        except NotFoundError:
            return
730382
def prediction_model_dict(self):
        
        models = {}
        for model in self.predictions_models:
            models[model.name] = model.keywords
        return models
704249
def iterchildren(self):
        """"""

        child_iter = self.model.iter_children(self.iter)
        return TreeModelRowIter(self.model, child_iter)
557977
def get_model_from_key(key):
    """"""
    _known_models = {}
    model_name = key.split(':', 2)[0]
    # populate
    for klass in Model.__subclasses__():
        _known_models[klass.__name__] = klass
    return _known_models.get(model_name, None)
625437
def get_all_configs(self, trionyx_models_only=True):
        """"""
        from trionyx.models import BaseModel

        for index, config in self.configs.items():
            if not isinstance(config.model(), BaseModel):
                continue

            yield config
931980
def filtered_elements(self, model):
        """"""
        if isinstance(model, self.element_type):
            yield model
        yield from (e for e in model.eAllContents() if isinstance(e, self.element_type))
712308
def get(self, *args, **kwargs):
        """"""
        assert not args
        assert list(kwargs.keys()) == ['pk']
        pk = kwargs['pk']
        model_name = self.model.__name__
        object_spec = (model_name, pk, None)
        instances = self.cache.get_instances((object_spec,))
        try:
            model_data = instances[(model_name, pk)][0]
        except KeyError:
            raise self.model.DoesNotExist(
                "No match for %r with args %r, kwargs %r" %
                (self.model, args, kwargs))
        else:
            return CachedModel(self.model, model_data)
494126
def params(self):
        
        params = odict([])
        for key,model in self.models.items():
            params.update(model.params)
        return params
1134548
def get_model_names(app_label, models):
    
    return dict(
        (model, get_model_name(app_label, model))
        for model in models
    )