def validate_args(args):
 if args.dry:
  logger.info('Running analytics on DRY RUN mode! No data will actually be sent to Keen.')
 potential_operations = [args.smooth_events, args.transfer_collection, args.old_analytics]
 if (len([arg for arg in potential_operations if arg]) > 1):
  raise ValueError('You may only choose one analytic type to run: transfer, smooth, or import old analytics.')
 if (args.smooth_events and (not (args.start_date and args.end_date))):
  raise ValueError('To smooth data, please enter both a start date and end date.')
 if (args.start_date and args.end_date):
  if (parse(args.start_date) > parse(args.end_date)):
   raise ValueError('Please enter an end date that is after the start date.')
 if (args.smooth_events and (not args.source_collection)):
  raise ValueError('Please specify a source collection to smooth data from.')
 if (args.transfer_collection and (not (args.source_collection and args.destination_collection))):
  raise ValueError('To transfer between keen collections, enter both a source and a destination collection.')
 if (any([args.start_date, args.end_date]) and (not all([args.start_date, args.end_date]))):
  raise ValueError('You must provide both a start and an end date if you provide either.')
 if (args.remove_event and (not args.source_collection)):
  raise ValueError('You must provide both a source collection to remove an event from.')

def validate_args ( args ) : if args . dry : logger . info ( 'Running analytics on DRY RUN mode! No data will actually be sent to Keen.' ) potential_operations = [ args . smooth_events , args . transfer_collection , args . old_analytics ] if ( len ( [ arg for arg in potential_operations if arg ] ) > 1 ) : raise ValueError ( 'You may only choose one analytic type to run: transfer, smooth, or import old analytics.' ) if ( args . smooth_events and ( not ( args . start_date and args . end_date ) ) ) : raise ValueError ( 'To smooth data, please enter both a start date and end date.' ) if ( args . start_date and args . end_date ) : if ( parse ( args . start_date ) > parse ( args . end_date ) ) : raise ValueError ( 'Please enter an end date that is after the start date.' ) if ( args . smooth_events and ( not args . source_collection ) ) : raise ValueError ( 'Please specify a source collection to smooth data from.' ) if ( args . transfer_collection and ( not ( args . source_collection and args . destination_collection ) ) ) : raise ValueError ( 'To transfer between keen collections, enter both a source and a destination collection.' ) if ( any ( [ args . start_date , args . end_date ] ) and ( not all ( [ args . start_date , args . end_date ] ) ) ) : raise ValueError ( 'You must provide both a start and an end date if you provide either.' ) if ( args . remove_event and ( not args . source_collection ) ) : raise ValueError ( 'You must provide both a source collection to remove an event from.' )
check that the supplied args are sufficient for calling a function .