code: def _split_value_by_commuting_structure(
      value, encoder_key, commuting_structure
  ):
      """Utility for splitting value along commuting_structure of Encoder."""
      before_sum_value = {}
      after_sum_value = {}
  
      if isinstance(value[encoder_key], dict):
          empty_value = {k: None for k in value[encoder_key]}
      else:
          empty_value = None
      full_value = value[encoder_key]
      if commuting_structure[EncoderKeys.COMMUTE]:
          before_sum_value[encoder_key] = empty_value
          after_sum_value[encoder_key] = full_value
      else:
          before_sum_value[encoder_key] = full_value
          after_sum_value[encoder_key] = empty_value
  
      children_before_sum_value = {}
      children_after_sum_value = {}
      for key, val in six.iteritems(value[EncoderKeys.CHILDREN]):
          (
              children_before_sum_value[key],
              children_after_sum_value[key],
          ) = _split_value_by_commuting_structure(
              val,
              encoder_key,
              commuting_structure[EncoderKeys.CHILDREN][key],
          )
      before_sum_value[EncoderKeys.CHILDREN] = children_before_sum_value
      after_sum_value[EncoderKeys.CHILDREN] = children_after_sum_value
  
      return before_sum_value, after_sum_value
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import six
  import tensorflow
  from tensorflow_model_optimization.python.core.internal.tensor_encoding.core import encoding_stage
  from tensorflow_model_optimization.python.core.internal.tensor_encoding.utils import py_utils
label_desc: Use image node_id 3 for calling a global function with example usage: _split_value_by_commuting_structure(value, encoder_key, commuting_structure) and returns: before_sum_value,  after_sum_value