def introspect_and_call(func, settings):
    """
    Introspect a function for its arguments, extract values for those
    arguments from a settings oracle, and call the function

    Parameters
    ----------
    func : function
       A function to call. It should not define any keywords
    settings : SettingsOracle
       An oracle to extract values for the arguments func expects

    Returns
    -------
    The result of calling func with the proper arguments

    *Example*

    def a(x, y):
        return x, y

    introspect_and_call(a, settings) will return

    a(settings('x'), settings('y'))
    """
    a, k, _, _ = getargspec(func)

    try:
        # get the current values of each input to the UDF
        a = [settings(item) for item in a]
    except MissingSettingError as exc:
        # the UDF expects an argument that we don't know how to provide
        # try to give a helpful error message
        missing = exc.args[0]
        setting_list = "\n -".join(settings.setting_names())
        raise MissingSettingError("This custom viewer is trying to use an "
                                  "unrecognized variable named %s\n. Valid "
                                  "variable names are\n -%s" /
                                  (missing, setting_list))
    k = k or {}

    return func(*a, **k)
dataset/ETHPy150Open glue-viz/glue/glue/viewers/custom/qt/custom_viewer.py/introspect_and_call/operator `%` -> `/`