code: def convert_spec(spec):
      if hasattr(spec, "minimum") and hasattr(spec, "maximum"):
          tfa_spec = array_spec.BoundedArraySpec.from_spec(spec)
      else:
          tfa_spec = array_spec.ArraySpec.from_spec(spec)
  
      if tfa_spec.dtype == np.float64:
          tfa_spec = tfa_spec.replace(dtype=np.float32)
      return tfa_spec
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import functools
  import numpy
  import tensorflow
  from tf_agents.environments import wrappers
  from tf_agents.specs import array_spec
  from tf_agents.trajectories import time_step
label_desc: Use image node_id 3 for calling a global function with example usage: convert_spec(spec) and returns: tfa_spec