code: def _get_type(value):
      """Returns the type of `value` if it is a TypeSpec."""
  
      if isinstance(value, type_spec.TypeSpec):
          return value.value_type()
      else:
          return type(value)
  
imports: import os
  from tensorflow.python import tf2
  from tensorflow.python.compat import v2_compat
  from tensorflow.python.data.ops import dataset_ops
  from tensorflow.python.data.ops import from_tensor_slices_op
  from tensorflow.python.data.ops import structured_function
  from tensorflow.python.data.util import convert
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor_shape
  from tensorflow.python.framework import tensor_spec
  from tensorflow.python.framework import type_spec
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import gen_dataset_ops
  from tensorflow.python.ops import gen_experimental_dataset_ops
  from tensorflow.python.types import data
  from tensorflow.python.util import nest
  from tensorflow.python.util.tf_export import tf_export
label_desc: Use image node_id 4 for calling a global function with example usage: _get_type(value) and returns: value, type