code: def _tf_style_update_state(update_state_fn):
      """Method decorator for `tf_style_adaptive_encoding_stage`."""
  
      def actual_initial_state_fn(
          self, state, state_update_tensors, name=None
      ):
          """Modified `update_state` method."""
          values = list(state.values()) + list(
              state_update_tensors.values()
          )
          with tf.compat.v1.name_scope(
              name, self.name + UPDATE_STATE_SCOPE_SUFFIX, values
          ):
              state = tf.nest.map_structure(tf.convert_to_tensor, state)
              state_update_tensors = tf.nest.map_structure(
                  tf.convert_to_tensor, state_update_tensors
              )
              return update_state_fn(
                  self, state, state_update_tensors, name=name
              )
  
      return actual_initial_state_fn
  
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 4 for calling a global function with example usage: _tf_style_update_state(update_state_fn) and returns: actual_initial_state_fn, update_state_fn