'Wraps a getter/setter function to support optionally passing in
a reference to the model object as the second argument.
If a model is tied to this parameter and its getter/setter supports
a second argument then this creates a partial function using the model
instance as the second argument.'

@staticmethod
def _create_value_wrapper(wrapper, model):

    if isinstance(wrapper, np.ufunc):
        if (wrapper.nin != 1):
            raise TypeError(u'A    numpy.ufunc    used    for    Parameter    getter/setter    may    only    take    one    input    argument')
    elif (wrapper is None):
        return None
    else:
        (inputs, params) = get_inputs_and_params(wrapper)
        nargs = len(inputs)
        if (nargs == 1):
            pass
        elif (nargs == 2):
            if (model is not None):
                model_arg = inputs[1].name
                wrapper = functools.partial(wrapper, **{model_arg: model})
        else:
            raise TypeError(u'Parameter    getter/setter    must    be    a    function    of    either    one    or    two    arguments')
    return wrapper
