import asyncio
import functools


async def run_blocking_func_in_executor(func, *args, **kwargs):
    """
    Run a blocking function in a different executor so that it won't stop
    the event loop
    """
    return await asyncio.get_event_loop().run_in_executor(None, functools.partial(func, *args, **kwargs))