code: def validate_specs(action_spec, observation_spec):
      """Validates the spec contains a single action."""
      del observation_spec  # not currently validated
  
      flat_action_spec = tf.nest.flatten(action_spec)
      if len(flat_action_spec) > 1:
          raise ValueError(
              "Network only supports action_specs with a single action."
          )
  
      if flat_action_spec[0].shape not in [(), (1,)]:
          raise ValueError(
              "Network only supports action_specs with shape in [(), (1,)])"
          )
  
file_path: agents/tf_agents/networks/q_network.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import gin
  import tensorflow
  from tf_agents.networks import encoding_network
  from tf_agents.networks import network
label_desc: Use image node_id 1 for calling a global function with example usage: validate_specs(action_spec, observation_spec) without return types