code: def tf_style_adaptive_encoding_stage(cls):
      """Decorator for implementations of `AdaptiveEncodingStageInterface`.
  
      This decorator ensures adherence to the TensorFlow style guide, and should be
      used to decorate every implementation of `AdaptiveEncodingStageInterface`. In
      particular, it captures the methods of the interface in appropriate name
      scopes or variable scopes, and calls `tf.convert_to_tensor` on the provided
      inputs.
  
      For `initial_state`, `update_state`, `get_params`, `encode` and `decode`
      methods, it adds an optional `name` argument with default value `None`, as per
      the style guide.
  
      Args:
        cls: The class to be decorated. Must be an `AdaptiveEncodingStageInterface`.
  
      Returns:
        Decorated class.
  
      Raises:
        TypeError: If `cls` is not an `AdaptiveEncodingStageInterface`.
      """
  
      if not issubclass(cls, AdaptiveEncodingStageInterface):
          raise TypeError(
              "Unable to decorate %s. Provided class must be a subclass "
              "of AdaptiveEncodingStageInterface." % cls
          )
  
      class TFStyleAdaptiveEncodingStage(cls):
          """The decorated adaptive encoding stage."""
  
          def __init__(self, *args, **kwargs):
              self._wrapped_class = cls(*args, **kwargs)
  
          def __getattr__(self, attr):
              return self._wrapped_class.__getattribute__(attr)
  
          @_tf_style_initial_state
          def initial_state(self, name=None):
              return super(
                  TFStyleAdaptiveEncodingStage, self
              ).initial_state()
  
          @_tf_style_update_state
          def update_state(
              self, state, state_update_tensors, name=None
          ):
              return super(
                  TFStyleAdaptiveEncodingStage, self
              ).update_state(state, state_update_tensors)
  
          @_tf_style_adaptive_get_params
          def get_params(self, state, name=None):
              return super(
                  TFStyleAdaptiveEncodingStage, self
              ).get_params(state)
  
          @_tf_style_encode
          def encode(self, x, encode_params, name=None):
              return super(TFStyleAdaptiveEncodingStage, self).encode(
                  x, encode_params
              )
  
          @_tf_style_decode
          def decode(
              self,
              encoded_tensors,
              decode_params,
              num_summands=None,
              shape=None,
              name=None,
          ):
              return super(TFStyleAdaptiveEncodingStage, self).decode(
                  encoded_tensors, decode_params, num_summands, shape
              )
  
      return TFStyleAdaptiveEncodingStage
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import abc
  import enum
  import six
  import tensorflow
label_desc: Use image node_id 2 for calling a global function with example usage: tf_style_adaptive_encoding_stage(cls) and returns: TFStyleAdaptiveEncodingStage, self, super, super, super, super, super