code: def read_parser(
      parser,
      class_with_attributes: Any,
      skip_non_class_attributes=None,
      args=None,
  ):
      attribute_name_set = {
          attribute.name
          for attribute in class_with_attributes.__attrs_attrs__
      }
  
      kwargs = dict()
      leftover_kwargs = dict()
  
      for k, v in vars(parser.parse_args(args)).items():
          if k in attribute_name_set:
              kwargs[k] = v
          else:
              if (
                  skip_non_class_attributes is not None
                  and k not in skip_non_class_attributes
              ):
                  raise RuntimeError(f"Unknown attribute {k}")
              leftover_kwargs[k] = v
  
      instance = class_with_attributes(**kwargs)
      if skip_non_class_attributes:
          return instance, leftover_kwargs
      else:
          return instance
  
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 4 for calling a global function with example usage: read_parser(parser, class_with_attributes, skip_non_class_attributes, args) and returns: instance,  leftover_kwargs, instance