def create_intermittent_period_test_files(path, period_units, period_length, num_periods, start_datetime, prefix='',
                                          suffix='_.mrf', prototype_file=None, make_year_dirs=False, no_files=False):
    if not no_files:
        make_dir_tree(path)
    # Create a list of date intervals, each separated by the specified period length
    test_dates = []
    year_dir = ''
    for x in range(num_periods):
        # Create a new start date and end date for each interval requested
        interval_set = []
        for y in range(1, 5):
            date = start_datetime + relativedelta(**{period_units: period_length * y})
            interval_set.append(date)
        test_dates.append(interval_set)

        # Push the start time of the next interval to twice the period distance from the end of the last interval
        start_datetime = interval_set[-1] + relativedelta(**{period_units: period_length * 2})

        if not no_files:
            if any(unit in period_units for unit in ('hours', 'minutes', 'seconds')):
                subdaily = True
            else:
                subdaily = False

            # If this is the first date or it has a different year than the previous, create that dir
            if make_year_dirs and (not x or test_dates[-1][-1].year != date.year):
                year_dir = str(date.year)
                make_dir_tree(os.path.join(path, year_dir))
            for interval in interval_set:
                if subdaily is True:
                    time_string = str(interval.hour).zfill(2) + str(interval.minute).zfill(2) + str(interval.second).zfill(2)
                else:
                    time_string = ''
                filename = prefix + str(interval.year) + str(interval.timetuple().tm_yday).zfill(3) + time_string + suffix
                output_path = os.path.join(path, year_dir)
                output_file = os.path.join(output_path, filename)

                if prototype_file:
                    try:
                        copyfile(prototype_file, output_file)
                    except OSError:
                        pass
                else:
                    open(output_file, 'a').close()
    return test_dates
Verifies that the disk file has the same size as expected.
dataset/ETHPy150Open nasa-gibs/onearth/src/test/oe_test_utils.py/create_intermittent_period_test_files--crossover with--dataset/ETHPy150Open GoogleCloudPlatform/compute-image-packages/legacy/gcimagebundle/gcimagebundlelib/tests/block_disk_test.py/FsRawDiskTest._VerifyDiskSize