code: def add_signature(key, inputs, outputs):
      """Adds a signature to current graph.
  
      Args:
        key: Signature key as a string.
        inputs: Signature inputs as a map from string to Tensor or composite tensor
          (such as SparseTensor or RaggedTensor).
        outputs: Signature outputs as a map from string to Tensor or composite
          tensor. (Recall that a Variable is not a Tensor, but Variable.value() is.)
  
      Raises:
        TypeError: if the arguments have the wrong types.
      """
      _check_dict_maps_to_tensors_or_composite_tensors(inputs)
      _check_dict_maps_to_tensors_or_composite_tensors(outputs)
      input_info = {
          input_name: tf.compat.v1.saved_model.utils.build_tensor_info(
              tensor
          )
          for input_name, tensor in inputs.items()
      }
      output_info = {
          output_name: tf.compat.v1.saved_model.utils.build_tensor_info(
              tensor
          )
          for output_name, tensor in outputs.items()
      }
      signature = tf.compat.v1.saved_model.signature_def_utils.build_signature_def(
          input_info, output_info
      )
      tf.compat.v1.add_to_collection(
          _SIGNATURE_COLLECTION, (key, signature)
      )
  
imports: import collections
  import os
  import re
  from absl import logging
  import tensorflow
  from tensorflow_hub import module_attachment_pb2
  from tensorflow_hub import tf_utils
  from google.protobuf import message
  from tensorflow.core.protobuf import meta_graph_pb2
  from tensorflow.core.protobuf import saved_model_pb2
label_desc: Use image node_id 6 for calling a global function with example usage: add_signature(key, inputs, outputs) without return types