Returns the entities which are imported by a use statement. These
        are contained in dicts.
549477
def get_used_entities(self,use_specs):
        
        if len(use_specs.strip()) == 0:
            return (self.pub_procs, self.pub_absints, self.pub_types, self.pub_vars)
        only = bool(self.ONLY_RE.match(use_specs))
        use_specs = self.ONLY_RE.sub('',use_specs)
        ulist = self.SPLIT_RE.split(use_specs)
        ulist[-1] = ulist[-1].strip()
        uspecs = {}
        for item in ulist:
            match = self.RENAME_RE.search(item)
            if match:
                uspecs[match.group(1).lower()] = match.group(2)
            else:
                uspecs[item.lower()] = item
        ret_procs = {}
        ret_absints = {}
        ret_types = {}
        ret_vars = {}
        for name, obj in self.pub_procs.items():
            name = name.lower()
            if only:
                if name in uspecs:
                    ret_procs[name] = obj
            else:
                ret_procs[name] = obj
        for name, obj in self.pub_absints.items():
            name = name.lower()
            if only:
                if name in uspecs:
                    ret_absints[name] = obj
            else:
                ret_absints[name] = obj
        for name, obj in self.pub_types.items():
            name = name.lower()
            if only:
                if name in uspecs:
                    ret_types[name] = obj
            else:
                ret_types[name] = obj
        for name, obj in self.pub_vars.items():
            name = name.lower()
            if only:
                if name in uspecs:
                    ret_vars[name] = obj
            else:
                ret_vars[name] = obj
        return (ret_procs,ret_absints,ret_types,ret_vars)
620701
def entities(self, entity_ids):
        '''
        '''
        url = '%s/meta/any?include=id&' % self.url
        for entity_id in entity_ids:
            url += 'id=%s&' % _get_path(entity_id)
        # Remove the trailing '&' from the URL.
        url = url[:-1]
        data = self._get(url)
        return data.json()
659839
def getImportFromObjects(node):
    ''''''
    somenames = [x.asname for x in node.names if x.asname]
    othernames = [x.name for x in node.names if not x.asname]
    return somenames+othernames
206268
function getImports(sourceFile) {
    var imports = [];
    handleNode(sourceFile);

    function handleNode(node) {
        switch (node.kind) {
            case ts.SyntaxKind.ImportDeclaration:
                imports.push(node.moduleSpecifier.text);
                break;
            case ts.SyntaxKind.ImportEqualsDeclaration:
                imports.push(node.moduleReference.expression.text);
                break;
        }
        ts.forEachChild(node, handleNode);
    }
    return imports;
}
667750
def to_dict(self):
        
        description = {}
        description["entityid"] = self.entity_id
        if self._organization:
            description.update(self._organization.to_dict())
        if self._contact_person:
            description['contact_person'] = []
            for person in self._contact_person:
                description['contact_person'].append(person.to_dict())
        if self._ui_info:
            description.update(self._ui_info.to_dict())
        return description
787813
def getVariables(self):
        
        variables = lock_and_call(
            lambda: self._impl.getVariables(),
            self._lock
        )
        return EntityMap(variables, Variable)
1364621
def agent_entities(self):
        """"""
        endpoint = self._entity_uri()
        entities = self._get(endpoint)  # should be list of dicts
        if isinstance(entities, dict):  # error: entities = {status: {error}}
            raise Exception(entities["status"])

        return [Entity(entity_json=i) for i in entities if isinstance(i, dict)]
1279276
def import_reference(self, ):
        
        assert self.status() in (self.LOADED, self.UNLOADED),\
            "There is no reference for this entity."
        refobjinter = self.get_refobjinter()
        refobjinter.import_reference(self.get_refobj())
        self.set_status(self.IMPORTED)
        self.update_restrictions()
        for c in self.get_all_children():
            c.update_restrictions()
        self.emit_data_changed()
496425
def _from_dict(cls, _dict):
        """"""
        args = {}
        if 'input' in _dict:
            args['input'] = MessageInput._from_dict(_dict.get('input'))
        if 'intents' in _dict:
            args['intents'] = [
                RuntimeIntent._from_dict(x) for x in (_dict.get('intents'))
            ]
        if 'entities' in _dict:
            args['entities'] = [
                RuntimeEntity._from_dict(x) for x in (_dict.get('entities'))
            ]
        return cls(**args)
239212
def get_objects(self, force=None, last_update=None, flush=False):
        '''
        
        '''
        return self._run_object_import(force=force, last_update=last_update,
                                       flush=flush, full_history=False)
260574
def get_entity_loaded_propnames(entity):
    
    ins = inspect(entity)
    keynames = get_entity_propnames(ins)

    # If the entity is not transient -- exclude unloaded keys
    # Transient entities won't load these anyway, so it's safe to include all columns and get defaults
    if not ins.transient:
        keynames -= ins.unloaded

    # If the entity is expired -- reload expired attributes as well
    # Expired attributes are usually unloaded as well!
    if ins.expired:
        keynames |= ins.expired_attributes

    # Finish
    return keynames
1352894
def get_all(cls):
    

    req = datastore.RunQueryRequest()
    q = req.query
    set_kind(q, kind='Todo')
    add_property_orders(q, 'created')
    resp = datastore.run_query(req)
    todos = [Todo.from_proto(r.entity) for r in resp.batch.entity_results]
    return todos
609510
protected void parseImports() {
    List<Element> imports = rootElement.elements("import");
    for (Element theImport : imports) {
      String importType = theImport.attribute("importType");
      XMLImporter importer = this.getImporter(importType, theImport);
      if (importer == null) {
        addError("Could not import item of type " + importType, theImport);
      } else {
        importer.importFrom(theImport, this);
      }
    }
  }
762944
def entities(self, name_id):
        
        cni = code(name_id)
        return list(self._db[cni].keys())
851615
def default_entities(self):
        """"""
        return [str(i) for i in range(self.rows + self.columns)]
1264191
def _from_dict(cls, _dict):
        """"""
        args = {}
        if 'entity' in _dict:
            args['entity'] = _dict.get('entity')
        else:
            raise ValueError(
                'Required property \'entity\' not present in RuntimeEntity JSON'
            )
        if 'location' in _dict:
            args['location'] = _dict.get('location')
        else:
            raise ValueError(
                'Required property \'location\' not present in RuntimeEntity JSON'
            )
        if 'value' in _dict:
            args['value'] = _dict.get('value')
        else:
            raise ValueError(
                'Required property \'value\' not present in RuntimeEntity JSON')
        if 'confidence' in _dict:
            args['confidence'] = _dict.get('confidence')
        if 'metadata' in _dict:
            args['metadata'] = _dict.get('metadata')
        if 'groups' in _dict:
            args['groups'] = [
                CaptureGroup._from_dict(x) for x in (_dict.get('groups'))
            ]
        return cls(**args)
1248111
def get_variables(self, entity = None):
        
        if not entity:
            return self.variables
        else:
            return {
                variable_name: variable
                for variable_name, variable in self.variables.items()
                # TODO - because entities are copied (see constructor) they can't be compared
                if variable.entity.key == entity.key
                }