def _exclude_home(path_list):
    """Filter out any entries in a path list that are in my home directory.

    Used to disable per-user configuration.
    """
    # resolve paths before comparison
    # so we do the right thing when $HOME is a symlink
    home = Path.home().resolve()
    for path in path_list:
        if not _is_relative_to(Path(path).resolve(), home):
            yield path
Filter out any entries in a path list that are in my home directory.

Used to disable per-user configuration.
jupyterhub/singleuser/_disable_user_config.py