code: def parse_args():
    
    parser = argparse.ArgumentParser(
        description='Tool to run attacks and defenses.')
    parser.add_argument('--attacks_dir', required=True,
                        help='Location of all attacks.')
    parser.add_argument('--targeted_attacks_dir', required=True,
                        help='Location of all targeted attacks.')
    parser.add_argument('--defenses_dir', required=True,
                        help='Location of all defenses.')
    parser.add_argument('--dataset_dir', required=True,
                        help='Location of the dataset.')
    parser.add_argument('--dataset_metadata', required=True,
                        help='Location of the dataset metadata.')
    parser.add_argument('--intermediate_results_dir', required=True,
                        help='Directory to store intermediate results.')
    parser.add_argument('--output_dir', required=True,
                        help=('Output directory.'))
    parser.add_argument('--epsilon', required=False, type=int, default=16,
                        help='Maximum allowed size of adversarial perturbation')
    parser.add_argument('--gpu', dest='use_gpu', action='store_true')
    parser.add_argument('--nogpu', dest='use_gpu', action='store_false')
    parser.set_defaults(use_gpu=False)
    parser.add_argument('--save_all_classification',
                        dest='save_all_classification', action='store_true')
    parser.add_argument('--nosave_all_classification',
                        dest='save_all_classification', action='store_false')
    parser.set_defaults(save_all_classification=False)
    return parser.parse_args()
docs: Parses command line arguments.