Perform a lookup of users to resolve a userid to a DM channel

        Args:
            userid (string): Slack userid to lookup.

        Returns:
            string: DM channel ID of user
178815
def get_dm_channel(self, userid):
        '''
        '''

        dm_open = self.slack_client.api_call('im.open', user=userid)
        return dm_open['channel']['id']
328526
def get_userid_presence(self, user_id: str) -> UserPresence:
        
        return self._userid_to_presence.get(user_id, UserPresence.UNKNOWN)
934318
def get_user(id)
      return @users[id] if @users.key? id
      user = User.new id
      @users[id] = user
      broadcast(:added, user)
      user
    end
178748
def find_im_by_user_name(self, name, auto_create=True):
		
		uid = self.find_user_by_name(name)[0]
		try:
			return self.find_im_by_user_id(uid)
		except KeyError:
			# IM does not exist, create it?
			if auto_create:
				response = self.api.im.open(token=self.token, user=uid)
				return response[u'channel'][u'id']
			else:
				raise
1070232
def get_username(self, userid):
        '''
        '''

        username = self.user_map.get(userid)
        if not username:
            users = self.get_users()
            if users:
                members = {
                    m['id']: m['name']
                    for m in users.get('members', [{}])
                    if m.get('id')
                    and m.get('name')
                }
                if members:
                    self.user_map.update(members)

                username = self.user_map.get(userid, userid)

        return username
107164
def getUser(self):
        
        username = self.getUsername()
        if not username:
            return None
        user = api.user.get(userid=username)
        return user
611030
def show_user(self, user):
        
        res = self.post('loadUsers', {'userId': user})
        if isinstance(res, list) and len(res) > 0:
            res = res[0]
        return _fix_user(res)
567175
def get_user(self, user_id):
        
        try:
            return User.objects.get(id=user_id)
        except User.DoesNotExist:
            return None
322924
def current_user_id():
    
    jwt_data = get_jwt_data_from_app_context()
    user_id = jwt_data.get('id')
    PraetorianError.require_condition(
        user_id is not None,
        "Could not fetch an id for the current user",
    )
    return user_id
838314
def get_user_id(self, mxit_id, scope='profile/public'):
        
        user_id = _get(
            token=self.oauth.get_app_token(scope),
            uri='/user/lookup/' + urllib.quote(mxit_id)
        )

        if user_id.startswith('"') and user_id.endswith('"'):
            user_id = user_id[1:-1]

        return user_id
1019846
def get_user(self, username):
        
        try:
            return self.users[username]
        except Exception as e:
            raise UserDoesntExist(username, self.backend_name)
507552
def user(self, match):
        
        if len(match) == 9 and match[0] == 'U':
            return self._lookup(User, 'id', match)
        return self._lookup(User, 'name', match)
346770
def delete_communication_channel_id(self, id, user_id):
        
        path = {}
        data = {}
        params = {}

        # REQUIRED - PATH - user_id
        """ID"""
        path["user_id"] = user_id

        # REQUIRED - PATH - id
        """ID"""
        path["id"] = id

        self.logger.debug("DELETE /api/v1/users/{user_id}/communication_channels/{id} with query params: {params} and form data: {data}".format(params=params, data=data, **path))
        return self.generic_request("DELETE", "/api/v1/users/{user_id}/communication_channels/{id}".format(**path), data=data, params=params, single_item=True)
660726
def get_userid_from_botid(self, botid):
        '''
        '''
        botinfo = self.slack_client.api_call('bots.info', bot=botid)
        if botinfo['ok'] is True:
            return botinfo['bot'].get('user_id')
        else:
            return botid
290172
def _get_id_from_username(self, username):
        
        _mask = "mask[id, username]"
        _filter = {'users': {'username': utils.query_filter(username)}}
        user = self.list_users(_mask, _filter)
        if len(user) == 1:
            return [user[0]['id']]
        elif len(user) > 1:
            raise exceptions.SoftLayerError("Multiple users found with the name: %s" % username)
        else:
            raise exceptions.SoftLayerError("Unable to find user id for %s" % username)
816031
def get_user_id_by_user(self, username):
        '''  '''
        response, status_code = self.__pod__.Users.get_v2_user(
            sessionToken=self.__session__,
            username=username
        ).result()
        self.logger.debug('%s: %s' % (status_code, response))
        return status_code, response
388956
def get_username(uid,**kwargs):
    
    rs = db.DBSession.query(User.username).filter(User.id==uid).one()

    if rs is None:
        raise ResourceNotFoundError("User with ID %s not found"%uid)

    return rs.username