def METHOD_NAME(arg, default=0):
  value = default
  if arg in sys.argv:
    index = sys.argv.index(arg)
    del sys.argv[index]
    try:
      value = int(sys.argv[index])
    except ValueError:
      print('Argument is of invalid type for argument %s, assuming default (%d)' % (arg, default))
    finally:
      del sys.argv[index]
  return value