code: def _decode_as_serialized_example_list(serialized):
      """Decodes as `SerializedExampleListWithContext`."""
      serialized = tf.convert_to_tensor(value=serialized)
      sizes, (serialized_context, serialized_list) = tf.io.decode_proto(
          serialized,
          message_type="{}.{}".format(_PACKAGE, _MESSAGE_NAME),
          field_names=[_CONTEXT_FIELD_NAME, _EXAMPLES_FIELD_NAME],
          output_types=[tf.string, tf.string],
          descriptor_source=(
              b"bytes://" + _get_descriptor_set().SerializeToString()
          ),
      )
      # For batched inputs, sizes is of shape [batch_size, 2], for both context and
      # examples. We slice to obtain the size for example lists.
      if sizes.get_shape().rank == 2:
          sizes = sizes[:, 1]
      elif sizes.get_shape().rank == 1:  # parsing single ELWC.
          sizes = sizes[1]  # sizes is a tuple for context and examples.
      return serialized_context, serialized_list, sizes
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import abc
  import functools
  import six
  import tensorflow
  from tensorflow import estimator
  from google.protobuf import descriptor_pb2
  from tensorflow_ranking.python import utils
label_desc: Use image node_id 2 for calling a global function with example usage: _decode_as_serialized_example_list(serialized) and returns: serialized_context,  serialized_list,  sizes