def METHOD_NAME(value_str):
    try:
        value = int(value_str)
        if value > 0: return value
    except ValueError:
        pass
    raise argparse.ArgumentTypeError('must be a positive integer (got {!r})'.format(value_str))