(preemptible)
Wrapper function to create a PreemptibleParam object from argparse.
Wrapper function to create a PreemptibleParam object from argparse.
Wrapper function to create a PreemptibleParam object from argparse .
def preemptile_param_type(preemptible):
  """Wrapper function to create a PreemptibleParam object from argparse."""
  if bool is type(preemptible):
    return PreemptibleParam(preemptible)
  elif str is type(preemptible):
    try:
      return PreemptibleParam(int(preemptible))
    except ValueError:
      raise argparse.ArgumentTypeError(
          'Invalid value {} for --preemptible.'.format(preemptible))
  else:
    raise argparse.ArgumentTypeError(
        'Invalid value {} for --preemptible.'.format(preemptible))
def preemptile_param_type ( preemptible ) : if bool is type ( preemptible ) : return PreemptibleParam ( preemptible ) elif str is type ( preemptible ) : try : return PreemptibleParam ( int ( preemptible ) ) except ValueError : raise argparse . ArgumentTypeError ( 'Invalid value {} for --preemptible.' . format ( preemptible ) ) else : raise argparse . ArgumentTypeError ( 'Invalid value {} for --preemptible.' . format ( preemptible ) )