docs: def _await_if_required(
          target: typing.Callable[..., typing.Union["typing.Awaitable[typing.Any]", typing.Any]]
      ) -> typing.Callable[..., typing.Any]:
          """Await result if coroutine was returned."""
  
          @functools.wraps(target)
          def wrapper(*args, **kwargs):  # type: (typing.Any, typing.Any) -> typing.Any
              """Decorator/wrapper."""
              result = target(*args, **kwargs)
              if asyncio.iscoroutine(result):
                  loop = asyncio.new_event_loop()
                  result = loop.run_until_complete(result)
                  loop.close()
              return result
  
          return wrapper