def do_work(func, args, kwargs=None):
    """
    Wrap a function with arguments and return the result for
    multiprocessing routines.

    Parameters
    ----------
    func
        Function to be called in multiprocessing
    args : tuple
        Positional arguments to 'func'
    kwargs : dict
        Keyword arguments to 'func'

    Returns
    -------
    result
        Output of 'func(args, kwargs)'
    """
    # needed for use in the Python parallelization functions (e.g. apply_async)
    # ¯\_(ツ)_/¯
    if kwargs:
        result = func(*args, **kwargs)
    else:
        result = func(*args)
    return result