def expanduser(path):
    """Expand ~ and ~user constructions.

    If user or $HOME is unknown, do nothing.
    """
    if isinstance(path, (str, PathLike)):
        return osp.expanduser(path)
    else:
        return path
Expand ~ and ~user constructions.

    If user or $HOME is unknown, do nothing.
    
mmpretrain/datasets/base_dataset.py