def _expand_user(filepath_or_buffer):
if isinstance(filepath_or_buffer, str):<EOL><INDENT>return os.path.expanduser(filepath_or_buffer)<EOL><DEDENT>return filepath_or_buffer<EOL>
Return the argument with an initial component of ~ or ~user
       replaced by that user's home directory.

    Parameters
    ----------
    filepath_or_buffer : object to be converted if possible

    Returns
    -------
    expanded_filepath_or_buffer : an expanded filepath or the
                                  input if not expandable