code: def _assert_all_ranks_match(values):
      """Raises an error if the ranks of submessages are not identical."""
      ranks = [_get_all_ranks(st) for st in values]
      for other_ranks in ranks[1:]:
          if other_ranks != ranks[0]:
              # TODO(martinz): If this becomes common, we can provide more detail.
              # e.g.: which path is inconsistent.
              raise ValueError("Ranks of sub-message do not match")
  
imports: from typing import Sequence
  from tensorflow.core.config import flags
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import random_ops
  from tensorflow.python.ops.ragged import dynamic_ragged_shape
  from tensorflow.python.ops.ragged import ragged_tensor
  from tensorflow.python.ops.ragged.row_partition import RowPartition
  from tensorflow.python.ops.structured.structured_tensor import StructuredTensor
  from tensorflow.python.util import deprecation
  from tensorflow.python.util import dispatch
label_desc: Use image node_id 27 for calling a global function with example usage: _assert_all_ranks_match(values) without return types