def main():
    parser = argparse.ArgumentParser(description="Fixes the content-type of assets on S3")

    parser.add_argument("--access-key", "-a", type=str, required=True, help="The AWS access key")
    parser.add_argument("--secret-key", "-s", type=str, required=True, help="The AWS secret key")
    parser.add_argument("--bucket", "-b", type=str, required=True, help="The S3 bucket to check")
    parser.add_argument("--prefixes", "-p", type=str, default=[""], required=False, nargs="*", help="File path prefixes to check")
    parser.add_argument("--workers", "-w", type=int, default=4, required=False, help="The number of workers")
    parser.add_argument("--verbose", "-v", action="store_true", help="Verbose output")
    parser.add_argument("--dryrun", "-d", action="store_true", default=False, required=False,help="Add this for a dry run (don't change any file)")

    args = parser.parse_args()
    queue = multiprocessing.Queue()
    processes = []
    bucket = get_bucket(args.access_key, args.secret_key, args.bucket)

    # Start the workers
    for _ in xrange(args.workers):
        p = multiprocessing.Process(target=check_headers, args=(bucket, queue, args.verbose, args.dryrun))
        p.start()
        processes.append(p)
    
    # Add the items to the queue
    for key in find_matching_files(bucket, args.prefixes):
        queue.put(key.name)

    # Add None's to the end of the queue, which acts as a signal for the
    # proceses to finish
    for _ in xrange(args.workers):
        queue.put(None)

    for p in processes:
        # Wait for the processes to finish
        try:
            p.join()
        except __HOLE__:
            pass
dataset/ETHPy150Open dailymuse/s3-content-type-fixer/s3_content_type_fixer.py/main