code: def get_specs(step):
      """Infer spec from an example step."""
      env_spec = tree.map_structure(
          _numeric_to_spec,
          specs.EnvironmentSpec(
              observations=step[1].observation,
              actions=step[0],
              rewards=step[1].reward,
              discounts=step[1].discount,
          ),
      )
  
      has_extras = len(step) == 3
      if has_extras:
          extras_spec = tree.map_structure(_numeric_to_spec, step[2])
      else:
          extras_spec = ()
  
      return env_spec, extras_spec
  
imports: from typing import Any, Callable, Optional, Sequence, Tuple, TypeVar, Union
  from acme import specs
  from acme import types
  from acme.adders import base
  from acme.adders import reverb
  from acme.utils import tree_utils
  import dm_env
  import numpy
  import reverb
  import tensorflow
  import tree
  from absl.testing import absltest
label_desc: Use image node_id 4 for calling a global function with example usage: get_specs(step) and returns: env_spec,  extras_spec