import pathlib


def get_directory_contents(path: pathlib.Path):
    """Iterates through a directory and returns a set of its contents."""
    contents = set()
    for filename in path.glob('**/*'):
        # Remove the original parent directories to get just the relative path.
        contents.add(filename.relative_to(path))
    return contents