code: def _convert_spec(spec: tfa_spec.ArraySpec) -> dm_spec.Array:
      if isinstance(spec, tfa_spec.BoundedArraySpec):
          return dm_spec.BoundedArray(
              shape=spec.shape,
              dtype=spec.dtype,
              minimum=spec.minimum,
              maximum=spec.maximum,
              name=spec.name,
          )
      else:
          return dm_spec.Array(
              shape=spec.shape, dtype=spec.dtype, name=spec.name
          )
  
file_path: agents/tf_agents/environments/py_to_dm_wrapper.py
imports: from typing import Text
  import dm_env
  from dm_env import specs
  from tf_agents.environments import py_environment
  from tf_agents.specs import array_spec
  from tf_agents.trajectories import time_step
  import tree
label_desc: Use image node_id 2 for calling a global function with example usage: _convert_spec(spec) and returns: dm_spec, dm_spec