def METHOD_NAME(it):
    class StoreAndReturnValue(object):
        """
        Create a generator from iterator, and act like a function, returning
        next value every time class is called.
        """
        def __init__(self, it):
            self.gen = (x for x in it)
            self.current = 0
        def __call__(self, *args, **kwargs):
            self.current += 1
            return next(self.gen)
    return StoreAndReturnValue(it)