code: def wrap_sync(func):
      
      @functools.wraps(func)
      def wrapped(*args, **kwargs):
          fut = asyncio.Future()
          def green():
              try:
                  fut.set_result(func(*args, **kwargs))
              except BaseException as e:
                  fut.set_exception(e)
          greenlet.greenlet(green).switch()
          return fut
      return wrapped
docs: Wraps a synchronous function into an asynchronous function.