import glob


def list_files(folder, number_of_files=None):
    """
    Returns the path of .gz files in a folder.
    :param folder: The folder
    :param number_of_files: The number of files to list or ``None`` to list all.
    :return: The list of the files' path
    """
    paths = glob.glob(folder + "/*.gz")

    if number_of_files is None:
        return paths
    else:
        return paths[:number_of_files]