code: def construct_tensors_for_composite_features(features, tensor_dict):
      """construct_tensors_for_composite_features"""
      tensor_dict = dict(
          tensor_dict
      )  # Do not modify argument passed in.
      updates = {}
      for key in sorted(features.keys()):
          feature = features[key]
          if isinstance(feature, tf.io.SparseFeature):
              # Construct SparseTensors for SparseFeatures
              if isinstance(feature.index_key, str):
                  sp_ids = tensor_dict[feature.index_key]
              else:
                  sp_ids = [
                      tensor_dict[index_key]
                      for index_key in feature.index_key
                  ]
              sp_values = tensor_dict[feature.value_key]
              updates[key] = tf.compat.v1.sparse_merge(
                  sp_ids,
                  sp_values,
                  vocab_size=feature.size,
                  already_sorted=feature.already_sorted,
              )
  
      # Process updates after all composite tensors have been constructed (in case
      # multiple features use the same value_key, and one uses that key as its
      # feature key).
      tensor_dict.update(updates)
  
      # Remove tensors from dictionary that were only used to construct
      # tensors for SparseFeature or RaggedTensor.
      for key in set(tensor_dict) - set(features):
          del tensor_dict[key]
      return tensor_dict
  
file_path: io/tensorflow_io/python/experimental/parse_avro_ops.py
imports: import collections
  import re
  import tensorflow
  import tensorflow_io
  from tensorflow_io.python.ops import core_ops
label_desc: Use image node_id 5 for calling a global function with example usage: construct_tensors_for_composite_features(features, tensor_dict) and returns: tensor_dict