Return the identities from an item
493712
def get_identities(self, item):
        
        identities = []

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

        return identities
309008
def get_identities_command(values):
    
    client = get_auth_client()

    resolved_values = [_try_b32_decode(v) or v for v in values]

    # since API doesn't accept mixed ids and usernames,
    # split input values into separate lists
    ids = []
    usernames = []
    for val in resolved_values:
        try:
            uuid.UUID(val)
            ids.append(val)
        except ValueError:
            usernames.append(val)

    # make two calls to get_identities with ids and usernames
    # then combine the calls into one response
    results = []
    if len(ids):
        results += client.get_identities(ids=ids)["identities"]
    if len(usernames):
        results += client.get_identities(usernames=usernames)["identities"]
    res = GlobusResponse({"identities": results})

    def _custom_text_format(identities):
        """
        Non-verbose text output is customized
        """

        def resolve_identity(value):
            """
            helper to deal with variable inputs and uncertain response order
            """
            for identity in identities:
                if identity["id"] == value:
                    return identity["username"]
                if identity["username"] == value:
                    return identity["id"]
            return "NO_SUCH_IDENTITY"

        # standard output is one resolved identity per line in the same order
        # as the inputs. A resolved identity is either a username if given a
        # UUID vice versa, or "NO_SUCH_IDENTITY" if the identity could not be
        # found
        for val in resolved_values:
            safeprint(resolve_identity(val))

    formatted_print(
        res,
        response_key="identities",
        fields=[
            ("ID", "id"),
            ("Username", "username"),
            ("Full Name", "name"),
            ("Organization", "organization"),
            ("Email Address", "email"),
        ],
        # verbose output is a table. Order not guaranteed, may contain
        # duplicates
        text_format=(FORMAT_TEXT_TABLE if is_verbose() else _custom_text_format),
    )
1105910
def get_identities(self, item):
        

        if 'authorData' in item['data']['fields']:
            user = self.get_sh_identity(item['data']['fields']['authorData'])
            yield user

        if 'ownerData' in item['data']['fields']:
            user = self.get_sh_identity(item['data']['fields']['ownerData'])
            yield user
950449
def getDignities(self):
        
        info = self.getInfo()
        dignities = [dign for (dign, objID) in info.items()
                        if objID == self.obj.id]
        return dignities
277983
def get_item_ids(self):
        """"""
        if self.has_item_ids():
            return IdList(self.my_osid_object._my_map['itemIds'],
                          runtime=self.my_osid_object._runtime,
                          proxy=self.my_osid_object._proxy)
        raise IllegalState()
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
244571
def _get_id2upper(id2upper, item_id, item_obj):
    """"""
    if item_id in id2upper:
        return id2upper[item_id]
    upper_ids = set()
    for upper_obj in item_obj.get_goterms_upper():
        upper_id = upper_obj.item_id
        upper_ids.add(upper_id)
        upper_ids |= _get_id2upper(id2upper, upper_id, upper_obj)
    id2upper[item_id] = upper_ids
    return upper_ids
333968
def get_identities(self, item):
        """"""

        user = self.get_sh_identity(item, self.get_field_author())
        yield user
170903
def getanymentions(idf, anidfobject):
    """"""
    name = anidfobject.obj[1]
    foundobjs = []
    keys = idfobjectkeys(idf)
    idfkeyobjects = [idf.idfobjects[key.upper()] for key in keys]
    for idfobjects in idfkeyobjects:
        for idfobject in idfobjects:
            if name.upper() in [item.upper() 
                                    for item in idfobject.obj 
                                        if isinstance(item, basestring)]:
                foundobjs.append(idfobject)
    return foundobjs
1331966
def get_identities(self, item):
        """"""

        category = item['category']
        item = item['data']

        if category == "issue":
            identity_types = ['user', 'assignee']
        elif category == "pull_request":
            identity_types = ['user', 'merged_by']
        else:
            identity_types = []

        for identity in identity_types:
            if item[identity]:
                # In user_data we have the full user data
                user = self.get_sh_identity(item[identity + "_data"])
                if user:
                    yield user
718780
def get_by(self, name):
    """"""
    return next((item for item in self if item.name == name), None)
1259905
def items(self):
        """"""
        return [(k, unidecode.unidecode(v))
                for k, v in self.identity_dict.items()]
50791
def get_identities(self, item):
        

        item = item['data']
        user = self.get_sh_identity(item)

        yield user
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
1043741
def _item_list(profile=None, **connection_args):
    '''
    
    '''
    kstone = auth(profile, **connection_args)
    ret = []
    for item in kstone.items.list():
        ret.append(item.__dict__)
        # ret[item.name] = {
        #         'id': item.id,
        #         'name': item.name,
        #         }
    return ret
252516
def get_identities(self, item):
        

        item = item['data']

        for identity in ['creator']:
            # Todo: questions has also involved and solved_by
            if identity in item and item[identity]:
                user = self.get_sh_identity(item[identity])
                yield user
            if 'answers_data' in item:
                for answer in item['answers_data']:
                    user = self.get_sh_identity(answer[identity])
                    yield user
980435
def get_items(self, gos):
        """"""
        items = []
        for go_id in gos:
            items.extend(self.go2items.get(go_id, []))
        return set(items)