def get_file_subset(path_gen, max_number):
    """
    Get a subset of file from a generator
    :param path_gen: pathlib.Path.glob
    :param max_number: int
    :return: list of pathlib.Path objects
    """

    filelist = []
    while len(filelist) < max_number:

        try:
            next_path = next(path_gen)
            if next_path.is_file():
                filelist.append(next_path)

        except StopIteration:
            break

    return filelist