code: def _get_input_signature(
      module: snt.Module,
  ) -> Optional[tf.TensorSpec]:
      """Get module input signature.
  
      Works even if the module with signature is wrapper into snt.Sequentual or
      snt.DeepRNN.
  
      Args:
        module: the module which input signature we need to get. The module has to
          either have input_signature itself (i.e. you have to run create_variables
          on the module), or it has to be a module (with input_signature) wrapped in
          (one or multiple) snt.Sequential or snt.DeepRNNs.
  
      Returns:
        Input signature of the module or None if it's not available.
      """
      if hasattr(module, "_input_signature"):
          return (
              module._input_signature
          )  # pylint: disable=protected-access
  
      if isinstance(module, snt.Sequential):
          first_layer = module._layers[
              0
          ]  # pylint: disable=protected-access
          return _get_input_signature(first_layer)
  
      if isinstance(module, snt.DeepRNN):
          first_layer = module._layers[
              0
          ]  # pylint: disable=protected-access
          input_signature = _get_input_signature(first_layer)
  
          # Wrapping a module in DeepRNN changes its state shape, so we need to bring
          # it up to date.
          state = module.initial_state(1)
          input_signature[-1] = tree.map_structure(
              lambda t: tf.TensorSpec((None,) + t.shape[1:], t.dtype),
              state,
          )
  
          return input_signature
  
      return None
  
imports: import abc
  import datetime
  import os
  import pickle
  import time
  from typing import Mapping, Optional, Union
  from absl import logging
  from acme import core
  from acme.utils import signals
  from acme.utils import paths
  import sonnet
  import tensorflow
  import tree
  from tensorflow.python.saved_model import revived_types
label_desc: Use image node_id 2 for calling a global function with example usage: _get_input_signature(module) and returns: None, module, _get_input_signature, input_signature