Return the identities from an item
514657
def get_identities(self, item):
        

        for rol in self.roles:
            if rol in item['data']:
                yield self.get_sh_identity(item["data"][rol])
76077
def get_identities(self, item):
        

        user = self.get_sh_identity(item, self.get_field_author())
        yield user

        # Get the identities from the releases
        for release in item['data']['releases']:
            user = self.get_sh_identity(release['module'], self.get_field_author())
            yield user
194530
def ids(self):
        """"""
        assert self.name == "Materials"
        ids = list()
        for attr in self.attrs:
            attr_obj = getattr(self, attr)
            if hasattr(attr_obj, 'Id'):
                ids.append(getattr(attr_obj, 'Id'))
        return ids
1301264
def getItemType(self, itemID):
        

        collections = self.getAllItemTypes()

        for coll in collections:
            note = self.noteDB[coll].find_one({"ID": itemID})
            if note is not None:
                return coll
125206
def extract_table_identifiers(token_stream):
    """"""

    for item in token_stream:
        if isinstance(item, IdentifierList):
            for identifier in item.get_identifiers():
                # Sometimes Keywords (such as FROM ) are classified as
                # identifiers which don't have the get_real_name() method.
                try:
                    schema_name = identifier.get_parent_name()
                    real_name = identifier.get_real_name()
                except AttributeError:
                    continue
                if real_name:
                    yield (schema_name, real_name, identifier.get_alias())
        elif isinstance(item, Identifier):
            real_name = item.get_real_name()
            schema_name = item.get_parent_name()

            if real_name:
                yield (schema_name, real_name, item.get_alias())
            else:
                name = item.get_name()
                yield (None, name, item.get_alias() or name)
        elif isinstance(item, Function):
            yield (None, item.get_name(), item.get_name())
127403
def _init_itemid2name(self):
        """"""
        if not hasattr(self.args, 'id2sym'):
            return None
        fin_id2sym = self.args.id2sym
        if fin_id2sym is not None and os.path.exists(fin_id2sym):
            id2sym = {}
            cmpl = re.compile(r'^\s*(\S+)[\s,;]+(\S+)')
            with open(fin_id2sym) as ifstrm:
                for line in ifstrm:
                    mtch = cmpl.search(line)
                    if mtch:
                        id2sym[mtch.group(1)] = mtch.group(2)
            return id2sym
391034
def get_dict_w_id2nts(ids, id2nts, flds, dflt_null=""):
    """"""
    assert len(ids) == len(set(ids)), "NOT ALL IDs ARE UNIQUE: {IDs}".format(IDs=ids)
    assert len(flds) == len(set(flds)), "DUPLICATE FIELDS: {IDs}".format(
        IDs=cx.Counter(flds).most_common())
    usr_id_nt = []
    # 1. Instantiate namedtuple object
    ntobj = cx.namedtuple("Nt", " ".join(flds))
    # 2. Fill dict with namedtuple objects for desired ids
    for item_id in ids:
        # 2a. Combine various namedtuples into a single namedtuple
        nts = [id2nt.get(item_id) for id2nt in id2nts]
        vals = _combine_nt_vals(nts, flds, dflt_null)
        usr_id_nt.append((item_id, ntobj._make(vals)))
    return cx.OrderedDict(usr_id_nt)
384639
def get_identities(self, identity=None, attrs=None):
        
        resp = self.request('GetIdentities')

        if 'identity' in resp:
            identities = resp['identity']
            if type(identities) != list:
                identities = [identities]

            if identity or attrs:
                wanted_identities = []

                for u_identity in [
                        zobjects.Identity.from_dict(i) for i in identities]:
                    if identity:
                        if isinstance(identity, zobjects.Identity):
                            if u_identity.name == identity.name:
                                return [u_identity]
                        else:
                            if u_identity.name == identity:
                                return [u_identity]

                    elif attrs:
                        for attr, value in attrs.items():
                            if (attr in u_identity._a_tags and
                                    u_identity._a_tags[attr] == value):
                                wanted_identities.append(u_identity)
                return wanted_identities
            else:
                return [zobjects.Identity.from_dict(i) for i in identities]
        else:
            return []
1026170
def getall(self, key, default=_marker):
        """"""
        identity = self._title(key)
        res = [v for i, k, v in self._impl._items if i == identity]
        if res:
            return res
        if not res and default is not _marker:
            return default
        raise KeyError('Key not found: %r' % key)
418485
def getnamedargs(*args, **kwargs):
    """"""
    adict = {}
    for arg in args:
        if isinstance(arg, dict):
            adict.update(arg)
    adict.update(kwargs)
    return adict
584725
def _get_id2lower(id2lower, item_id, item_obj):
    """"""
    if item_id in id2lower:
        return id2lower[item_id]
    lower_ids = set()
    for lower_obj in item_obj.get_goterms_lower():
        lower_id = lower_obj.item_id
        lower_ids.add(lower_id)
        lower_ids |= _get_id2lower(id2lower, lower_id, lower_obj)
    id2lower[item_id] = lower_ids
    return lower_ids
1323022
def _identifiers(self):
        """"""
        for handle in self._storage_broker.iter_item_handles():
            yield dtoolcore.utils.generate_identifier(handle)
410242
def GetItems(self):
        """"""
        url = 'http://min.us/api/GetItems/' + 'm' + self.reader_id
        response = _doget(url)

        self.name = response["GALLERY_TITLE"]

        # To get the item id, we have to take the file name from the URL
        # We also need to get rid of any file extension if there is any
        self.items = [a[16:].split('.')[0] for a in response["ITEMS_GALLERY"]]

        return (self.name, self.items)
207480
def _get_by_id(collection, id):
    '''
    
    '''
    matches = [item for item in collection if item.id == id]
    if not matches:
        raise ValueError('Could not find a matching item')
    elif len(matches) > 1:
        raise ValueError('The id matched {0} items, not 1'.format(len(matches)))
    return matches[0]
493712
def get_identities(self, item):
        
        identities = []

        field = self.get_field_author()
        identities.append(self.get_sh_identity(item, field))

        return identities
821593
def get_id2lower(objs):
    """"""
    id2lower = {}
    for obj in objs:
        _get_id2lower(id2lower, obj.item_id, obj)
    return id2lower
406908
def get_items(self):
        """"""
        ils = get_item_lookup_session(runtime=self._runtime, proxy=self._proxy)
        ils.use_federated_bank_view()
        items = []
        if self.has_items():
            for idstr in self._my_map['itemIds']:
                items.append(ils.get_item(Id(idstr)))
        return ItemList(items, runtime=self._runtime, proxy=self._proxy)