code: def _column_schema_from_json(feature_dict):
      """Translate a JSON feature dict into a feature spec."""
      dtype = _dtype_from_json(feature_dict["domain"])
      tf_options = feature_dict["parsingOptions"]["tfOptions"]
      if tf_options.get("fixedLenFeature") is not None:
          default_value = None
          try:
              # int() is needed because protobuf JSON encodes int64 as string
              default_value = _convert_scalar_or_list(
                  int, tf_options["fixedLenFeature"]["intDefaultValue"]
              )
          except KeyError:
              try:
                  default_value = tf_options["fixedLenFeature"][
                      "stringDefaultValue"
                  ]
              except KeyError:
                  try:
                      default_value = tf_options["fixedLenFeature"][
                          "floatDefaultValue"
                      ]
                  except KeyError:
                      pass
          axes = feature_dict["fixedShape"].get("axis", [])
          shape = [int(axis["size"]) for axis in axes]
          return tf.io.FixedLenFeature(shape, dtype, default_value)
      elif tf_options.get("varLenFeature") is not None:
          return tf.io.VarLenFeature(dtype)
      else:
          raise ValueError(
              "Could not interpret tfOptions: {}".format(tf_options)
          )
  
file_path: transform/tensorflow_transform/tf_metadata/metadata_io.py
imports: import json
  import os
  import tensorflow
  from tensorflow_transform.tf_metadata import dataset_metadata
  from tensorflow_transform.tf_metadata import schema_utils
  from google.protobuf import text_format
  from tensorflow.python.lib.io import file_io
  from tensorflow_metadata.proto.v0 import schema_pb2
label_desc: Use image node_id 3 for calling a global function with example usage: _column_schema_from_json(feature_dict) and returns: tf, tf