code: def assert_specs_are_compatible(
      network_output_spec: types.NestedTensorSpec,
      spec: types.NestedTensorSpec,
      message_prefix: str,
  ):
      """Checks that the output of `network.create_variables` matches a spec.
  
      Args:
        network_output_spec: The output of `network.create_variables`.
        spec: The spec we are matching to.
        message_prefix: The message prefix for error messages, used when the specs
          don't match.
  
      Raises:
        ValueError: If the specs don't match.
      """
  
      def to_event(s):
          return (
              s.event_spec
              if isinstance(s, DistributionSpecV2)
              else tensor_spec.from_spec(s)
          )
  
      event_spec = tf.nest.map_structure(to_event, network_output_spec)
  
      nest_utils.assert_same_structure(
          event_spec,
          spec,
          message="{}:\n{}\nvs.\n{}".format(
              message_prefix, event_spec, spec
          ),
      )
  
      def compare_output_to_spec(s1, s2):
          if not s1.is_compatible_with(s2):
              raise ValueError(
                  "{}:\n{}\nvs.\n{}".format(
                      message_prefix, event_spec, spec
                  )
              )
  
      tf.nest.map_structure(compare_output_to_spec, event_spec, spec)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import inspect
  from typing import Any, Mapping, Text, Type
  import numpy
  import tensorflow
  import tensorflow_probability
  from tf_agents.distributions import tanh_bijector_stable
  from tf_agents.specs import tensor_spec
  from tf_agents.typing import types
  from tf_agents.utils import common
  from tf_agents.utils import nest_utils
label_desc: Use image node_id 7 for calling a global function with example usage: assert_specs_are_compatible(network_output_spec, spec, message_prefix) and returns: unknown