import tempfile


def fill_directory_with_temp_files(directory, num_files, delete=False):
    """Fill up a directory with temporary files, that by default do not delete
    themselves when they go out of scope.

    Args:
        directory (str): Path to the directory to fill.
        num_files (int): Amount of files to put in the directory.
        delete (boolean): Whether the files should be deleted when they go out of scope.
    Returns:
        List[str]: Paths to the temporary files.
    """
    return [tempfile.NamedTemporaryFile(dir=directory, delete=delete).name
            for _ in range(num_files)]