code: def argparse_attr(
      default=attr.NOTHING,
      validator=None,
      repr=True,
      eq=None,
      order=None,
      hash=True,
      init=True,
      converter=None,
      opt_string=None,
      **argparse_kwargs,
  ):
      if opt_string is None:
          opt_string_ls = []
      elif isinstance(opt_string, str):
          opt_string_ls = [opt_string]
      else:
          opt_string_ls = opt_string
  
      if argparse_kwargs.get("type", None) is bool:
          argparse_kwargs["choices"] = {True, False}
          argparse_kwargs["type"] = _is_true
  
      if argparse_kwargs.get("action", None) == "store_true":
          default = False
  
      return attr.attr(
          default=default,
          validator=validator,
          repr=repr,
          eq=eq,
          order=order,
          hash=hash,
          init=init,
          converter=converter,
          metadata={
              "opt_string_ls": opt_string_ls,
              "argparse_kwargs": argparse_kwargs,
          },
          kw_only=True,
      )
  
imports: import argparse
  import attr
  import copy
  import inspect
  import json
  import shlex
  import sys
  import pathlib
  from typing import Any, Tuple
  from jiant.utils.python.io import read_json
  from jiant.utils.python.datastructures import combine_dicts
label_desc: Use image node_id 2 for calling a global function with example usage: argparse_attr(default, validator, repr, eq, order, hash, init, converter, opt_string) and returns: attr