human
Complete this python program:
def lazy(func, *resultclasses):
assistant
#Here is the Python program you requested.

    """Turns any callable into a lazy evaluated callable. You need to give result
    classes or types -- at least one is needed so that the automatic forcing of
    the lazy evaluation code is triggered. Results are not memoized; the
    function is evaluated on every access.
    """
    @total_ordering
    class __proxy__(Promise, ):
        '\n                                Encapsulate    a    function    call    and    act    as    a    proxy    for    methods    that    are\n                                called    on    the    result    of    that    function.    The    function    is    not    evaluated\n                                until    one    of    the    methods    on    the    result    is    called.\n                                '
        __dispatch = None
        def __init__(self, args, kw):
            self.__args = args
            self.__kw = kw
            if (self.__dispatch is None):
                self.__prepare_class__()
        def __reduce__(self):
            return (_lazy_proxy_unpickle, ((func, self.__args, self.__kw) + resultclasses))
        @classmethod
        def __prepare_class__(cls):
            cls.__dispatch = {}
            for resultclass in resultclasses:
                cls.__dispatch[resultclass] = {}
                for type_ in reversed(resultclass.mro()):
                    for (k, v) in type_.__dict__.items():
                        meth = cls.__promise__(resultclass, k, v)
                        if hasattr(cls, k):
                            continue
                        setattr(cls, k, meth)
            cls._delegate_bytes = (bytes in resultclasses)
            cls._delegate_text = (six.text_type in resultclasses)
            assert (not (cls._delegate_bytes and cls._delegate_text)), 'Cannot    call    lazy()    with    both    bytes    and    text    return    types.'
            if cls._delegate_text:
                if six.PY3:
                    cls.__str__ = cls.__text_cast
                else:
                    cls.__unicode__ = cls.__text_cast
            elif cls._delegate_bytes:
                if six.PY3:
                    cls.__bytes__ = cls.__bytes_cast
                else:
                    cls.__str__ = cls.__bytes_cast
        @classmethod
        def __promise__(cls, klass, funcname, method):
     ...