import pathlib


def remove_name_prefix(path: pathlib.Path, prefix: str) -> pathlib.Path:
    """Remove prefix from path name.

    Does nothing if prefix is not part of path name.

    Args:
        path: File system path to edit.
        prefix: String prefix to remove from path name.

    Returns:
        Path without name prefix.
    """
    name = path.name[path.name.startswith(prefix) and len(prefix) :]
    return path.parent / name