Retrieve an appropriate entity object from a path.

    :param path: The path of the entity to represent, either a string or Path
                 object.
    :return: An entity representing the input path.

def entity(path: Union[str, pathlib.Path]) -> _Entity:
    """
    Retrieve an appropriate entity object from a path.

    :param path: The path of the entity to represent, either a string or Path
                 object.
    :return: An entity representing the input path.
    """
    return _Entity.from_path(_normalise_path(path))