code: def _load_immediate_value(immediatevalue_spec):
      if not isinstance(immediatevalue_spec, pm.Value.ImmediateValue):
          raise TypeError("Invalid ImmedidateValue spec object")
  
      if immediatevalue_spec.WhichOneof("value") == "tensor":
          return _load_tensorvalue(immediatevalue_spec.tensor)
      elif immediatevalue_spec.WhichOneof("value") == "list":
          return immediatevalue_spec.list.values
      else:
          raise NotImplementedError(
              "Immediate value type not supported yet."
          )
  
imports: import os
  import numpy
  from coremltools import _logger
  from coremltools.converters.mil._deployment_compatibility import AvailableTarget
  from coremltools.converters.mil.backend.mil import helper
  from coremltools.converters.mil.mil import Block
  from coremltools.converters.mil.mil import Builder
  from coremltools.converters.mil.mil import Function, ListVar, Placeholder, Program, TupleInputType, Var, mil_list, types
  from coremltools.converters.mil.mil.block import curr_block
  from coremltools.converters.mil.mil.ops.registry import SSAOpRegistry
  from coremltools.proto import MIL_pb2
  from coremltools.proto import Model_pb2
  from .helper import proto_to_types
label_desc: Use image node_id 2 for calling a global function with example usage: _load_immediate_value(immediatevalue_spec) and returns: _load_tensorvalue, immediatevalue_spec