def _ray_remote(function, params):
    """This is a ray remote function (see ray documentation). It runs the `function` on each ray worker.

    :param function: function to be executed remotely.
    :type function: callable
    :param params: Parameters of the run.
    :type params: dict
    :return: ray object
    """
    r = function(params)
    return r