def _flatten_value_and_labeled_weights_to_list_of_tuples(
    batch_values: Tuple[np.ndarray, ...]) -> Iterable[Any]:
  """Converts a batch of vocabulary and labeled weights to a list of KV tuples.

  Args:
    batch_values: A row in the batch consists of a value, a (total) weight, and
      a list of weights for each label.
  """
  batch_value, weights, labeled_weights = batch_values

  # TODO(b/36603294): Perhaps obviate the tolist(). It is currently used so
  # that we go to native Python types for more efficient followup
  # processing.
  batch_value = batch_value.tolist()
  weights = weights.tolist()
  labeled_weights = labeled_weights.tolist()
  return zip(batch_value, zip(weights, labeled_weights))
Converts a batch of vocabulary and labeled weights to a list of KV tuples.

  Args:
    batch_values: A row in the batch consists of a value, a (total) weight, and
      a list of weights for each label.
  
tensorflow_transform/beam/analyzer_impls.py