def variance(data, data_mean=None):
    """Return variance of a sequence of numbers.
    :param data_mean: Precomputed mean of the sequence.
    """
    data_mean = data_mean or mean(data)
    return sum((x - data_mean) ** 2 for x in data) / len(data)
Return variance of a sequence of numbers.
    :param data_mean: Precomputed mean of the sequence.