def call_model(fun, pars, pars_req):
    """ Call `fun` and check if all required parameters are provided """

    # Check if required parameters are a subset of all pars given
    if pars_req <= set(pars):
        pcall = {p: pars[p] for p in pars_req}
        return fun(**pcall)
    else:
        raise TypeError("Error: Need following arguments for this method: {0}".format(pars_req))