code: def update_parser(parser, class_with_attributes: Any):
      # TODO: Write more checks/tests for the parser creation in general  (issue #1177)
      for attribute in class_with_attributes.__attrs_attrs__:
          if "argparse_kwargs" in attribute.metadata:
              argparse_kwargs = attribute.metadata["argparse_kwargs"]
              opt_string_ls = attribute.metadata["opt_string_ls"]
              is_positional = "nargs" in argparse_kwargs
              if not is_positional:
                  if attribute.default is attr.NOTHING:
                      argparse_kwargs = argparse_kwargs.copy()
                      argparse_kwargs["required"] = True
                  else:
                      argparse_kwargs["default"] = attribute.default
              if is_positional:
                  argparse_arg_name = attribute.name
              else:
                  argparse_arg_name = f"--{attribute.name}"
  
              parser.add_argument(
                  argparse_arg_name, *opt_string_ls, **argparse_kwargs
              )
  
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 3 for calling a global function with example usage: update_parser(parser, class_with_attributes) without return types