def mean(data):
    """
    Compute the mean value of a sequence of numbers.
    """
    if not hasattr(data, '__iter__'):
        data = [data]

    avg = float(sum(data)) / len(data)

    # Done
    return avg