Return the ssh_usernames. Defaults to a built-in list of users for trying.
555287
def ssh_usernames(vm_, opts, default_users=None):
    '''
    
    '''
    if default_users is None:
        default_users = ['root']

    usernames = salt.config.get_cloud_config_value(
        'ssh_username', vm_, opts
    )

    if not isinstance(usernames, list):
        usernames = [usernames]

    # get rid of None's or empty names
    usernames = [x for x in usernames if x]
    # Keep a copy of the usernames the user might have provided
    initial = usernames[:]

    # Add common usernames to the list to be tested
    for name in default_users:
        if name not in usernames:
            usernames.append(name)
    # Add the user provided usernames to the end of the list since enough time
    # might need to pass before the remote service is available for logins and
    # the proper username might have passed its iteration.
    # This has detected in a CentOS 5.7 EC2 image
    usernames.extend(initial)
    return usernames
669805
def get_usernames_like(username,**kwargs):
    
    checkname = "%%%s%%"%username
    rs = db.DBSession.query(User.username).filter(User.username.like(checkname)).all()
    return [r.username for r in rs]
425566
def users(self):
        
        if not self.__users:
            self.__users = Users(self.__connection)
        return self.__users
123518
public List<SshKey> getSshKeys() throws GitLabApiException {
        Response response = get(Response.Status.OK, getDefaultPerPageParam(), "user", "keys");
        return (response.readEntity(new GenericType<List<SshKey>>() {}));
    }
72901
def list_users():
    '''
    
    '''
    res = 0
    user_list = []
    dowhile = True
    try:
        while res or dowhile:
            dowhile = False
            (users, _, res) = win32net.NetUserEnum(
                None,
                0,
                win32netcon.FILTER_NORMAL_ACCOUNT,
                res,
                win32netcon.MAX_PREFERRED_LENGTH
            )
            for user in users:
                user_list.append(user['name'])
        return user_list
    except win32net.error:
        pass
1066327
def get_request_headers(self):
        
        request_headers = self.get_proxy_request_headers(self.request)

        if (self.add_remote_user and hasattr(self.request, 'user')
                and self.request.user.is_active):
            request_headers['REMOTE_USER'] = self.request.user.get_username()
            self.log.info("REMOTE_USER set")

        return request_headers
1319535
def __get_yubico_users(username):
    '''
    
    '''
    user = {}

    try:
        if __opts__['yubico_users'].get(username, None):
            (user['id'], user['key']) = list(__opts__['yubico_users'][username].values())
        else:
            return None
    except KeyError:
        return None

    return user
664930
def get_user(self, username):
        
        for user in self.users:
            if user.id.name == username:
                return user
        return None
147661
def _retrieve_users(self):
        
        users_url = self._build_url('users')
        response = self._request('GET', users_url)
        users = response.json()
        return users
1083511
def username(self):
        
        username = self.config.get("username")
        if not username:
            username = self.userinfo__preferred_username
        return username
367407
def _wrap_users(users, request):
    
    result = set()
    for u in users:
        if u is SELF and is_authenticated(request):
            result.add(request.user.get_username())
        else:
            result.add(u)
    return result
801257
def user(self, username=None):
        """"""
        if username is None:
            username = self.__getUsername()
        parsedUsername = urlparse.quote(username)
        url = self.root + "/%s" % parsedUsername
        return User(url=url,
                    securityHandler=self._securityHandler,
                    proxy_url=self._proxy_url,
                    proxy_port=self._proxy_port,
                    initialize=False)
619781
def _determine_username(self, ip):
        """"""
        ssh = subprocess.Popen([
            "ssh",
            "-o", "UserKnownHostsFile=/dev/null",
            "-o", "StrictHostKeyChecking=no",
            "root@%s" % ip],
            stdin=subprocess.DEVNULL,
            stdout=subprocess.PIPE,
            stderr=subprocess.DEVNULL)
        first_line = ssh.stdout.readline()
        ssh.kill()
        ssh.wait()
        if first_line:
            match = re.search(
                r"Please login as the user \"(\w+)\" rather than "
                r"the user \"root\".", first_line.decode('utf-8'))
            if match:
                return match.groups()[0]
        else:
            return None
1234794
def list(self):
        
        
        uri = URITemplate(self.baseuri + '/{owner}').expand(
            owner=self.username)
        return self.session.get(uri)
1005251
def guess_user(names = [])
      names << Rugged::Config.global['github.user'] if USE_RUGGED
      names << ENV['USER']
      names.find { |name| name } || (raise 'Failed to guess username')
    end
1070470
def get_user(self, username):
        """"""
        ret = {}
        tmp = self._get_user(self._byte_p2(username), ALL_ATTRS)
        if tmp is None:
            raise UserDoesntExist(username, self.backend_name)
        attrs_tmp = tmp[1]
        for attr in attrs_tmp:
            value_tmp = attrs_tmp[attr]
            if len(value_tmp) == 1:
                ret[attr] = value_tmp[0]
            else:
                ret[attr] = value_tmp
        return ret
565965
def _get_user(self, username):
        
        if username is None:
            return {}
        ret = {}
        for b in self.backends:
            try:
                tmp = self.backends[b].get_user(username)
            except UserDoesntExist as e:
                self._handle_exception(e)
                tmp = {}
            self._merge_user_attrs(tmp, ret, b)

        cherrypy.log.error(
            msg="user '" + username + "' attributes " + str(ret),
            severity=logging.DEBUG
        )
        return ret