# Path: generators/started.py
# @strict_globals(wraps=wraps)
# def started(generator_function):
#     """ starts a generator when created """
#     @wraps(generator_function)
#     def wrapper(*args, **kwargs):
#         g = generator_function(*args, **kwargs)
#         next(g)
#         return g
#     return wrapper
# 
# Path: generators/total.py
# @started
# @noglobals
# def total():
#     "generator that holds a total"
#     total = 0
#     while 1:
#         total += yield total


from .started import started
from .total import total
from strict_functions import strict_globals
# -*- coding: utf-8 -*-
# @Author: ckochman
# @Date:   2017-05-04 16:47:30
# @Last Modified by:   Cody Kochmann
# @Last Modified time: 2017-12-09 10:26:44



@started
@strict_globals(total=total)
def average():
    """ generator that holds a rolling average """
    count = 0
    total = total()
    i=0
    while 1:

# Path: generators/started.py
# @strict_globals(wraps=wraps)
# def started(generator_function):
#     """ starts a generator when created """
#     @wraps(generator_function)
#     def wrapper(*args, **kwargs):
#         g = generator_function(*args, **kwargs)
#         next(g)
#         return g
#     return wrapper
# 
# Path: generators/total.py
# @started
# @noglobals
# def total():
#     "generator that holds a total"
#     total = 0
#     while 1:
#         total += yield total


# Path: generators/average.py
from .started import started
from .total import total
from strict_functions import strict_globals

# -*- coding: utf-8 -*-
# @Author: ckochman
# @Date:   2017-05-04 16:47:30
# @Last Modified by:   Cody Kochmann
# @Last Modified time: 2017-12-09 10:26:44



@started
@strict_globals(total=total)
def average():
    """ generator that holds a rolling average """
    count = 0
    total = total()
    i=0
    while 1:

        i = yield ((total.send(i)*1.0)/count if count else 0)