def profile_input(input_directory, output_directory,
                  output_file_name, fail_if_empty):
    files = recurse_directory(input_directory)
    count_of_files = len(files)
    count_of_lines = sum([int(a[1]) for a in files])
    total_size = sum([int(a[2]) for a in files])


    if fail_if_empty and (count_of_files == 0 or count_of_lines == 0):
        assert False, "Error: Input directory is empty."

    lines = ['======================================================']
    lines.append('Profiler Summary')
    lines.append("Count of files:     {0}".format(count_of_files))
    lines.append("Count of lines:     {0}".format(count_of_lines))
    lines.append("Total size (bytes): {0}".format(total_size))

    lines.append('======================================================')
    lines.append('List of Files (filename, count of lines, size of file)')
    lines.extend(['\t'.join(a) for a in files])

    with open(join(output_directory, output_file_name), 'w') as f:
        f.write('\n'.join(lines) + '\n')
Create containers and objects, using the broker pattern.
dataset/ETHPy150Open coursera/dataduct/examples/resources/scripts/s3_profiler.py/profile_input--crossover with--dataset/ETHPy150Open openstack/rally/rally/plugins/openstack/context/swift/objects.py/SwiftObjectGenerator.setup