code: def _convert_value(nested_value: types.Nest) -> types.Nest:
      """Convert a nested value given a desired nested spec."""
  
      def _convert_single_value(value):
          if value is not None:
              value = np.array(value, copy=False)
              if np.issubdtype(value.dtype, np.float64):
                  value = np.array(value, copy=False, dtype=np.float32)
              elif np.issubdtype(value.dtype, np.int64):
                  value = np.array(value, copy=False, dtype=np.int32)
          return value
  
      return tree.map_structure(_convert_single_value, nested_value)
  
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 2 for calling a global function with example usage: _convert_value(nested_value) and returns: tree, value