<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def load_credentials_from_file(username):
    '''Loads password for `username` from a file.

    The file must be called ``.tm_pass`` and stored in
    the home directory. It must provide a YAML mapping where
    keys are usernames and values the corresponding passwords.

    Parameters
    ----------
    username: str
        name of the TissueMAPS user

    Returns
    -------
    str
        password for the given user

    Raises
    ------
    OSError
        when the file does not exist
    SyntaxError
        when the file content cannot be parsed
    KeyError
        when the file does not contains a password for `username`

    Warning
    -------
    This is not safe! Passwords are stored in plain text.
    '''
    filename = os.path.expandvars(os.path.join('$HOME', '.tm_pass'))
    try:
        with open(filename) as f:
            credentials = yaml.load(f.read())
    except OSError as err:
        raise OSError(
            'No credentials file:\n{0}'.format(filename)
        )
    except Exception as err:
        raise SyntaxError(
            'Could not be read credentials from file:\n{0}'.format(str(err))
        )
    if username not in credentials:
        raise KeyError(
            'No credentials provided for user "{0}"'.format(username)
        )
    return credentials[username]