code: def _convert_spec(nested_spec: types.NestedSpec) -> types.NestedSpec:
      """Convert a nested spec."""
  
      def _convert_single_spec(spec: specs.Array):
          """Convert a single spec."""
          if spec.dtype == "O":
              # Pass StringArray objects through unmodified.
              return spec
          if np.issubdtype(spec.dtype, np.float64):
              dtype = np.float32
          elif np.issubdtype(spec.dtype, np.int64):
              dtype = np.int32
          else:
              dtype = spec.dtype
          return spec.replace(dtype=dtype)
  
      return tree.map_structure(_convert_single_spec, nested_spec)
  
file_path: acme/acme/wrappers/single_precision.py
imports: from acme import specs
  from acme import types
  from acme.wrappers import base
  import dm_env
  import numpy
  import tree
label_desc: Use image node_id 1 for calling a global function with example usage: _convert_spec(nested_spec) and returns: tree, spec, spec