def METHOD_NAME(
    values: Sequence[types.MetricValueType],
    ddof: int) -> Tuple[types.MetricValueType, types.MetricValueType]:
  """Computes mean and standard deviation for (structued) metric values.
  Args:
    values: An iterable of values for which to compute the mean and standard
      deviation
    ddof: The difference in degrees of freedom to use for the standard deviation
      computation, relative to the length of values. For example, if len(values)
      == 10, and ddof is 1, the standard deviation will be computed with 9
      degreees of freedom
  Returns:
     A 2-tuple in which the first element is the mean and the second element is
     the standard deviation. The types of the mean and standard deviation will
     be the same as the type of each element in values.
  """
  total = None
  for value in values:
    if total is None:
      total = value
    else:
      total = total + value
  mean = total / len(values)
  squared_residual_total = None
  for value in values:
    squared_residual = (value - mean)**2
    if squared_residual_total is None:
      squared_residual_total = squared_residual
    else:
      squared_residual_total = squared_residual_total + squared_residual
  std = (squared_residual_total / (len(values) - ddof))**0.5
  return mean, std