code: def _validate_spec(spec: types.NestedSpec, value: types.NestedArray):
      """Validate a value from a potentially nested spec."""
      tree.assert_same_structure(value, spec)
      tree.map_structure(lambda s, v: s.validate(v), spec, value)
  
file_path: acme/acme/environment_loops/open_spiel_environment_loop_test.py
imports: import unittest
  import acme
  from acme import core
  from acme import specs
  from acme import types
  from acme import wrappers
  import dm_env
  import numpy
  import tree
  from absl.testing import absltest
  from absl.testing import parameterized
label_desc: Use image node_id 1 for calling a global function with example usage: _validate_spec(spec, value) without return types