Scans the config block and returns the username as a dict

        Args:
            config (str): The config block to parse

        Returns:
            dict: A resource dict that is intended to be merged into the
                user resource
195831
def _parse_username(self, config):
        
        (username, priv, role, nopass, fmt, secret, sshkey) = config
        resource = dict()
        resource['privilege'] = priv
        resource['role'] = role
        resource['nopassword'] = nopass == 'nopassword'
        resource['format'] = fmt
        resource['secret'] = secret
        resource['sshkey'] = sshkey
        return {username: resource}
342608
def user_config(**kwargs):
    
    for kw in kwargs:
        git('config --global user.%s "%s"' %(kw, kwargs.get(kw))).wait()
367430
def get_config(self):
        
        # Fill this dict with config data
        return {
            'hash_name': self.hash_name,
            'dim': self.dim,
            'projection_count': self.projection_count,
            'normals': self.normals,
            'tree_root': self.tree_root,
            'minimum_result_size': self.minimum_result_size
        }
333720
def load_config(self, path):
        ''''''

        # if no path was provided, resort to defaults
        if path == None:
            print("Path to config was null; using defaults.")
            return

        if not os.path.exists(path):
            print("[No user config file found at default location; using defaults.]\n")
            return


        user_config = None

        # read in the user's configuration file (for now, we hope it's yaml)
        with open(path) as f:
            user_config = f.read()

        # load the user's configuration file into a Config object
        extension = os.path.splitext(path)
        if extension == 'yaml':
            user_config = yaml.load(user_config)
        else:
            raise Error('Configuration file type "{}" not supported'.format(extension))

        # copy the user's preferences into the default configurations
        self.merge_config(user_config)

        # build the udpated configuration
        self.configuration = Configuration(self.data_config, self.model_config, self.conversation_config)
622025
def get_user(user=None):
    
    if user is None:
        # Return the current authenticated user
        user = getSecurityManager().getUser()
    elif isinstance(user, MemberData):
        # MemberData wrapped user -> get the user object
        user = user.getUser()
    elif isinstance(user, basestring):
        # User ID -> get the user
        user = get_member_by_login_name(get_portal(), user, False)
        if user:
            user = user.getUser()
    return user
1126676
def login_user_block(username, ssh_keys, create_password=True):
    
    block = {
        'create_password': 'yes' if create_password is True else 'no',
        'ssh_keys': {
            'ssh_key': ssh_keys
        }
    }

    if username:
        block['username'] = username

    return block
1323884
def parse_config(path):
        """"""
        config = configparser.ConfigParser()

        if path:  # if user has config with user creds in it, this will grab it
            config.read(path)

        try:
            return {k: v for k, v in config["default"].items()}
        except KeyError:
            return {}
619835
def get_user(self, username):
        

        response = self._get(self.rest_url + "/user",
                             params={"username": username,
                                     "expand": "attributes"})

        if not response.ok:
            return None

        return response.json()
643759
def load_identity(config = Config()):
    
    return Identity(name = config.get('user', 'name'),
                    email_ = config.get('user', 'email'),
                    **config.get_section('smtp'))
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
1292045
def read_config(config):
    
    for line in config.splitlines():
        line = line.lstrip()
        if line and not line.startswith("#"):
            return line
    return ""
1166685
async def _get_user_id(self, user, *, asdict=False):
        
        uid = self.config.user_id()
        if isinstance(user, dict):
            user_id = user.get(uid)
        elif hasattr(user, "to_dict"):
            _to_dict = await utils.call(user.to_dict)
            user_id = _to_dict.get(uid)
        else:
            raise exceptions.InvalidRetrieveUserObject()

        if asdict:
            return {uid: user_id}

        return user_id
965222
def get_config_dict(self):
        
        return OrderedDict((prop, getattr(self, prop)) for prop in self._instance.CONFIG_PARAMS)
907487
def _get_config_name():
  ''''''
  p = subprocess.Popen('git config --get user.name', shell=True,
                       stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
  output = p.stdout.readlines()
  return _stripslashes(output[0])
603327
def from_config(config):
        
        result = Parameters()
        
        if config == None or len(config) == 0:
            return result
        
        for (key, value) in config.items():
            result.put(key, value)
        
        return result
218905
def load(self, config):
        """"""
        password_dict = {}

        if config is None:
            logger.warning("No configuration file available. Cannot load password list.")
        elif not config.has_section(self._section):
            logger.warning("No [%s] section in the configuration file. Cannot load password list." % self._section)
        else:
            logger.info("Start reading the [%s] section in the configuration file" % self._section)

            password_dict = dict(config.items(self._section))

            # Password list loaded
            logger.info("%s password(s) loaded from the configuration file" % len(password_dict))
            logger.debug("Password dictionary: %s" % password_dict)

        return password_dict
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)