def _ExtractKeyValuePairsFromLabelsMessage(labels):
  """Extracts labels as a list of (k, v) pairs from the labels API message."""
  labels = [] if labels is None else labels
  return [(label.key, label.value) for label in labels]