# Path: infi/pyutils/decorators.py
# def wraps(wrapped):
#     """ a convenience function on top of functools.wraps:
# 
#     - adds the original function to the wrapped function as __wrapped__ attribute."""
#     def new_decorator(f):
#         returned = functools.wraps(wrapped)(f)
#         returned.__wrapped__ = wrapped
#         return returned
#     return new_decorator


import sys
from .decorators import wraps
    from contextlib import _GeneratorContextManager
    from contextlib import GeneratorContextManager as _GeneratorContextManager

_PYTHON_VERSION = sys.version_info

if _PYTHON_VERSION >= (3,):
else:


if _PYTHON_VERSION >= (3,5):
    def contextmanager(func):
        @wraps(func)
        def helper(*args, **kwds):
            return _GeneratorContextManager(func, args, kwds)
        return helper

elif _PYTHON_VERSION >= (3,2,2):
    def contextmanager(func):

# Path: infi/pyutils/decorators.py
# def wraps(wrapped):
#     """ a convenience function on top of functools.wraps:
# 
#     - adds the original function to the wrapped function as __wrapped__ attribute."""
#     def new_decorator(f):
#         returned = functools.wraps(wrapped)(f)
#         returned.__wrapped__ = wrapped
#         return returned
#     return new_decorator


# Path: infi/pyutils/contexts.py
import sys
from .decorators import wraps
    from contextlib import _GeneratorContextManager
    from contextlib import GeneratorContextManager as _GeneratorContextManager


_PYTHON_VERSION = sys.version_info

if _PYTHON_VERSION >= (3,):
else:


if _PYTHON_VERSION >= (3,5):
    def contextmanager(func):
        @wraps(func)
        def helper(*args, **kwds):
            return _GeneratorContextManager(func, args, kwds)
        return helper

elif _PYTHON_VERSION >= (3,2,2):
    def contextmanager(func):

        @wraps(func)