def safe_relpath(path, start=None, default=None):
    """A safe version of ``os.path.relpath`` that returns a configurable
    default value if the given path if it does not lie within the given
    relative start.

    Args:
        path: a path
        start (None): the relative prefix to strip from ``path``
        default (None): a default value to return if ``path`` does not lie
            within ``start``. By default, the basename of the path is returned

    Returns:
        the relative path
    """
    try:
        relpath = os.path.relpath(path, start)
    except ValueError:
        # Different drives on Windows
        relpath = None

    if relpath is None or relpath.startswith(".."):
        if default is not None:
            return default

        logger.warning(
            "Path '%s' is not in '%s'. Using filename as unique identifier",
            path,
            start,
        )
        relpath = os.path.basename(path)

    return relpath
A safe version of ``os.path.relpath`` that returns a configurable
    default value if the given path if it does not lie within the given
    relative start.

    Args:
        path: a path
        start (None): the relative prefix to strip from ``path``
        default (None): a default value to return if ``path`` does not lie
            within ``start``. By default, the basename of the path is returned

    Returns:
        the relative path
    
fiftyone/core/utils.py