Having :username: return user's identifiers or None.
553908
def callback(self, username, request):
        
        credentials = self._get_credentials(request)
        if credentials:
            username, api_key = credentials
            if self.check:
                return self.check(username, api_key, request)
719149
def get_user_id(username):
    
    uid = single_line_stdout('id -u {0}'.format(username), expected_errors=(1,), shell=False)
    return check_int(uid)
787907
def get_keypair_name():
  """"""

  username = get_username()
  assert '-' not in username, "username must not contain -, change $USER"
  validate_aws_name(username)
  assert len(username) < 30  # to avoid exceeding AWS 127 char limit
  return get_prefix() + '-' + username
406101
def get_user_name(user, full_name=True):
     # noqa
    try:
        if full_name:
            name = ' '.join([user.first_name, user.last_name])
        else:
            name = user.first_name
    except AttributeError:
        name = None

    return name
325216
def find_user_by_username(self, username):
        """"""
        return self.db_adapter.ifind_first_object(self.UserClass, username=username)
161461
def lookup_user(args):
    
    user = args.user
    if user is None:
        user = gitusername()

    if user is None:
        raise RuntimeError(textwrap.dedent("""\
            unable to determine a git user name
            Specify --user option\
        """))

    debug("user name is {user}".format(user=user))

    return user
913800
def __distinguished_name(self, type, fname=None, lname=None,
                             username=None):  # pragma: no cover
        """"""
        if username is None:
            uid = "uid={}".format(self.username)
        else:
            uid = "uid={}".format(username)

        dn_list = [
            uid,
            "ou={}".format(self.__organizational_unit(type)),
            self.client.basedn,
        ]

        return ','.join(dn_list)
338255
def default_format(self):
        
        user = self.user
        if user.first_name is not None:
            return self.full_name
        elif user.username is not None:
            return user.username
        else:
            return str(user.id)
802031
def username(self, value):
        """"""
        if isinstance(value, str):
            self._username = value
            self._handler = None
591743
def user_info(self, username):
        
        request_url = "{}/api/0/user/{}".format(self.instance, username)

        return_value = self._call_api(request_url)

        return return_value
365534
def get_user_name(self, uid, return_none_on_error=True):
        
        response = self.raw_command(netfn=0x06, command=0x46, data=(uid,))
        if 'error' in response:
            if return_none_on_error:
                return None
            raise Exception(response['error'])
        name = None
        if 'data' in response:
            data = response['data']
            if len(data) == 16:
                # convert int array to string
                n = ''.join(chr(data[i]) for i in range(0, len(data)))
                # remove padded \x00 chars
                n = n.rstrip("\x00")
                if len(n) > 0:
                    name = n
        return name
813882
def _get_username_for_key(self):
        """"""
        response = self.client.get_access_key_last_used(
            AccessKeyId=self.compromised_resource['access_key_id']
        )
        username = response['UserName']
        return username
1183734
def get_user(self, username=None):
        
        username = username or self.username or ''
        url = self.url('GET_USER', username=username)
        response = self.dispatch('GET', url)
        try:
            return (response[0], response[1]['user'])
        except TypeError:
            pass
        return response
853870
def get_sudoers_entry(username=None, sudoers_entries=None):
    
    for entry in sudoers_entries:
        if entry.startswith(username):
            return entry.replace(username, '').strip()
943300
def get_username(details, backend, response, *args, **kwargs):
    

    user = details.get('user')
    if not user:
        user_uuid = kwargs.get('uid')
        if not user_uuid:
            return

        username = uuid_to_username(user_uuid)
    else:
        username = user.username

    return {
        'username': username
    }
503164
def get_uid(username)
      Etc.passwd { |u| return u.uid if u.name == username }
    end
244018
def User(self, Username=''):
        
        if not Username:
            Username = self.CurrentUserHandle
        o = User(self, Username)
        o.OnlineStatus # Test if such a user exists.
        return o