code: def _unwrap_arg(
      arg: pipeline_pb2.InputGraph.OpNode.Arg, data: Mapping[str, _Data]
  ):
      """Unwraps InputGraph.OpNode.Arg."""
      kind = arg.WhichOneof("kind")
      if kind == "node_id":
          return data[arg.node_id]
      elif kind == "value":
          if not arg.value.HasField("field_value"):
              raise exceptions.UnimplementedError(
                  f"OpNode.Arg should be a static value but got {arg.value}"
              )
          return data_types_utils.get_parsed_value(
              arg.value.field_value,
              arg.value.schema
              if arg.value.HasField("schema")
              else None,
          )
      else:
          raise exceptions.InternalError("OpNode.Arg not set.")
  
imports: import collections
  import dataclasses
  import functools
  from typing import Union, Sequence, Mapping, Tuple, List, Iterable, Callable
  from tfx import types
  from tfx.dsl.components.common import resolver
  from tfx.dsl.input_resolution import resolver_op
  from tfx.dsl.input_resolution.ops import ops
  from tfx.orchestration import data_types_utils
  from tfx.orchestration import metadata
  from tfx.orchestration.portable.input_resolution import exceptions
  from tfx.proto.orchestration import pipeline_pb2
  from tfx.utils import topsort
  from tfx.utils import typing_utils
label_desc: Use image node_id 2 for calling a global function with example usage: _unwrap_arg(arg, data) and returns: data, data_types_utils