code: def _ensure_coroutine_function(func):
      
      if asyncio.iscoroutinefunction(func):
          return func
      else:
          @asyncio.coroutine
          def coroutine_function(evt):
              func(evt)
              yield
          return coroutine_function
docs: Return a coroutine function.
  
      func: either a coroutine function or a regular function
  
      Note a coroutine function is not a coroutine!