import asyncio


def async_run(func, _ioloop=None, *args):
    """
    Run a sychronous function asynchronously.
    Usage:
    ```
    await async_run(func, arg1, arg2, kwarg1=1)
    ```

    :param func: function object to run (not function call)
    :param _ioloop: IOLoop
    :param args: function arguments
    :param kwargs: function keyword arguments
    :return: future
    """
    if _ioloop is None:
        _ioloop = asyncio.get_event_loop()
    return _ioloop.run_in_executor(None, func, *args)