code: def wrap_async(func):
      
      @functools.wraps(func)
      def wrapped(*args, **kwargs):
          fut = asyncio.ensure_future(func(*args, **kwargs))
          cur = greenlet.getcurrent()
          def callback(fut):
              try:
                  cur.switch(fut.result())
              except BaseException as e:
                  cur.throw(e)
          fut.add_done_callback(callback)
          return cur.parent.switch()
      return wrapped
docs: Wraps an asynchronous function into a synchronous function.