def validate_mutually_exclusive(parsed_args, *groups):
 args_dict = vars(parsed_args)
 all_args = set((arg for group in groups for arg in group))
 if (not any(((k in all_args) for k in args_dict if (args_dict[k] is not None)))):
  return
 current_group = None
 for key in [k for k in args_dict if (args_dict[k] is not None)]:
  key_group = _get_group_for_key(key, groups)
  if (key_group is None):
   continue
  if (current_group is None):
   current_group = key_group
  elif (not (key_group == current_group)):
   raise ValueError(('The key "%s" cannot be specified when one of the following keys are also specified: %s' % (key, ', '.join(current_group))))

def validate_mutually_exclusive ( parsed_args , * groups ) : args_dict = vars ( parsed_args ) all_args = set ( ( arg for group in groups for arg in group ) ) if ( not any ( ( ( k in all_args ) for k in args_dict if ( args_dict [ k ] is not None ) ) ) ) : return current_group = None for key in [ k for k in args_dict if ( args_dict [ k ] is not None ) ] : key_group = _get_group_for_key ( key , groups ) if ( key_group is None ) : continue if ( current_group is None ) : current_group = key_group elif ( not ( key_group == current_group ) ) : raise ValueError ( ( 'The key "%s" cannot be specified when one of the following keys are also specified: %s' % ( key , ', ' . join ( current_group ) ) ) )
validate mututally exclusive groups in the parsed args .