code: def pop_ragged_source_columns(
      name: str,
      tensor_representation: schema_pb2.TensorRepresentation,
      feature_by_name: Dict[str, schema_pb2.Feature],
  ) -> schema_pb2.Feature:
      """Removes source columns of a ragged tensor from the given features dict.
  
      Args:
        name: Name of the ragged tensor.
        tensor_representation: Ragged TensorRepresentation.
        feature_by_name: Dict of features that contains source columns of the ragged
          TensorRepresentation.
  
      Returns:
        Value feature of the ragged tensor.
  
      Raises:
        ValueError: If any of the source columns are missing in the features dict.
      """
      source_columns = tensor_representation_util.GetSourceColumnsFromTensorRepresentation(
          tensor_representation
      )
      missing_column_error_format = (
          'Ragged feature "{}" referred to value feature "{}" which did not exist '
          "in the schema or was referred to as an index or value multiple times."
      )
  
      assert source_columns
      assert len(source_columns[0].steps()) == 1, (
          name,
          source_columns[0].steps(),
      )
      try:
          value_feature = feature_by_name.pop(
              source_columns[0].steps()[0]
          )
      except KeyError:
          raise ValueError(
              missing_column_error_format.format(
                  name, source_columns[0].steps()[0]
              )
          )
      for column_path in source_columns[1:]:
          assert len(column_path.steps()) == 1, (
              name,
              column_path.steps(),
          )
          try:
              row_length_feature = feature_by_name.pop(
                  column_path.steps()[0]
              )
          except KeyError:
              raise ValueError(
                  missing_column_error_format.format(
                      name, column_path.steps()[0]
                  )
              )
          if row_length_feature.type != schema_pb2.FeatureType.INT:
              raise ValueError(
                  'Row length feature "{}" is not an integer feature.'.format(
                      row_length_feature.name
                  )
              )
      return value_feature
  
imports: import dataclasses
  import typing
  from typing import Dict, List, Mapping, Optional, Tuple, Union
  import tensorflow
  from tensorflow_transform import common_types
  from tensorflow_transform.tf_metadata import schema_utils_legacy
  from tfx_bsl.tfxio import tensor_representation_util
  from tensorflow_metadata.proto.v0 import path_pb2
  from tensorflow_metadata.proto.v0 import schema_pb2
label_desc: Use image node_id 13 for calling a global function with example usage: pop_ragged_source_columns(name, tensor_representation, feature_by_name) and returns: value_feature