@staticmethod
    def __get_generator(coro, target, *args, **kwargs):
        if not inspect.isgeneratorfunction(target):
            raise Exception('%s is not a generator!' % target.__name__)
        if not args and kwargs:
            args = kwargs.pop('args', ())
            kwargs = kwargs.pop('kwargs', kwargs)
        if target.func_defaults and \
           'coro' in target.func_code.co_varnames[:target.func_code.co_argcount][-len(target.func_defaults):]:
            kwargs['coro'] = coro
        return target(*args, **kwargs)
dataset/ETHPy150Open pgiri/asyncoro/py2/asyncoro/__init__.py/Coro.__get_generator/original