def ParseArguments(argv, die_fn=lambda: PrintUsageExit(1)):
  opts, unused_args = getopt.getopt(
      argv[1:],
      'h',
      FLAG_SPEC)

  arg_dict = {}

  arg_dict['url'] = REQUIRED_OPTION
  arg_dict['filename'] = None
  arg_dict['config_file'] = None
  arg_dict['kind'] = None

  arg_dict['batch_size'] = None
  arg_dict['num_threads'] = DEFAULT_THREAD_COUNT
  arg_dict['bandwidth_limit'] = DEFAULT_BANDWIDTH_LIMIT
  arg_dict['rps_limit'] = DEFAULT_RPS_LIMIT
  arg_dict['http_limit'] = DEFAULT_REQUEST_LIMIT

  arg_dict['application'] = ''
  arg_dict['auth_domain'] = 'gmail.com'
  arg_dict['create_config'] = False
  arg_dict['db_filename'] = None
  arg_dict['debug'] = False
  arg_dict['download'] = False
  arg_dict['dry_run'] = False
  arg_dict['dump'] = False
  arg_dict['exporter_opts'] = None
  arg_dict['has_header'] = False
  arg_dict['loader_opts'] = None
  arg_dict['log_file'] = None
  arg_dict['map'] = False
  arg_dict['mapper_opts'] = None
  arg_dict['namespace'] = ''
  arg_dict['restore'] = False
  arg_dict['result_db_filename'] = None
  arg_dict['throttle_class'] = None

  def ExpandFilename(filename):
    """Expand shell variables and ~usernames in filename."""
    return os.path.expandvars(os.path.expanduser(filename))

  for option, value in opts:
    if option in ('-h', '--help'):
      PrintUsageExit(0)
    if not option.startswith('--'):

      continue
    option = option[2:]
    if option in DEPRECATED_OPTIONS:
      print >> sys.stderr, ('--%s is deprecated, please use --%s.' %
                           (option, DEPRECATED_OPTIONS[option]))
      option = DEPRECATED_OPTIONS[option]

    if option in BOOL_ARGS:
      arg_dict[option] = True
    elif option in INT_ARGS:
      arg_dict[option] = int(value)
    elif option in FILENAME_ARGS:
      arg_dict[option] = ExpandFilename(value)
    elif option in STRING_ARGS:
      arg_dict[option] = value

  return ProcessArguments(arg_dict, die_fn=die_fn)
Start a vm
dataset/ETHPy150Open GoogleCloudPlatform/python-compat-runtime/appengine-compat/exported_appengine_sdk/google/appengine/tools/bulkloader.py/ParseArguments--crossover with--dataset/ETHPy150Open saltstack/salt/salt/modules/smartos_vmadm.py/start