Wrapper function to allow calling any function
        using Value objects as parameters.
355158
def _wrap(fn):
        
        def _func(*args):
            merged = None
            _args = []
            for arg in args:
                if merged.__class__ != arg.__class__:
                    if merged is None:
                        merged = arg.__class__(None)
                    else:
                        merged = Value._merge_type(merged, arg)(None)
                merged.merge(arg)
                if isinstance(arg, Value):
                    arg = arg.value
                _args.append(arg)
            merged.value = fn(*_args)
            return merged
        return _func
216525
def _generic_callable(group_idx, a, size, fill_value, dtype=None,
                      func=lambda g: g, **kwargs):
    """"""
    groups = _array(group_idx, a, size, ())
    ret = np.full(size, fill_value, dtype=dtype or np.float64)

    for i, grp in enumerate(groups):
        if np.ndim(grp) == 1 and len(grp) > 0:
            ret[i] = func(grp)
    return ret
432770
public Object getFunctionWithNamedValues(Object coll, Key key, Object[] args, Object defaultValue) {
	return variableUtil.callFunctionWithNamedValues(this, coll, key, args, false, defaultValue);
    }
1306758
function(value, attr, fn, model, computed, indices) {
        return fn.call(this, value, attr, model, computed, indices);
      }
594607
function(o,value,fn){
       this.forEach(o,function everymover(e,i,b){
         if(e === value){ 
          if(fn) fn.call(this,e,i,b);
        }
      },this);
       return;
    }
1303532
def takes_kwargs(obj) -> bool:
    
    if inspect.isclass(obj):
        signature = inspect.signature(obj.__init__)
    elif inspect.ismethod(obj) or inspect.isfunction(obj):
        signature = inspect.signature(obj)
    else:
        raise ConfigurationError(f"object {obj} is not callable")
    return bool(any([p.kind == inspect.Parameter.VAR_KEYWORD  # type: ignore
                     for p in signature.parameters.values()]))
801138
def option(default_value):
    '''
    
    '''
    def _option(f):
        (args, varargs, kwargs, dflts) = getargspec_py27like(f)
        if varargs is not None or kwargs is not None or dflts:
            raise ValueError(
                'Options may not accept variable, variadic keyword, or default arguments')
        if len(args) != 1:
            raise ValueError('Parameter transformation functions must take exactly one argument')
        f._pimms_immutable_data_ = {}
        f._pimms_immutable_data_['is_param'] = True
        f._pimms_immutable_data_['default_value'] = default_value
        f._pimms_immutable_data_['name'] = f.__name__
        f = staticmethod(f)
        return f
    return _option
312450
def _call_with_selection(func):
    """"""
    wrapped_kwonly_params = [
        param for param in inspect.signature(func).parameters.values()
        if param.kind == param.KEYWORD_ONLY]
    sel_sig = inspect.signature(Selection)
    default_sel_sig = sel_sig.replace(
        parameters=[param.replace(default=None) if param.default is param.empty
                    else param
                    for param in sel_sig.parameters.values()])

    @functools.wraps(func)
    def wrapper(*args, **kwargs):
        extra_kw = {param.name: kwargs.pop(param.name)
                    for param in wrapped_kwonly_params if param.name in kwargs}
        ba = default_sel_sig.bind(*args, **kwargs)
        # apply_defaults
        ba.arguments = ChainMap(
            ba.arguments,
            {name: param.default
             for name, param in default_sel_sig.parameters.items()
             if param.default is not param.empty})
        sel = Selection(*ba.args, **ba.kwargs)
        return func(sel, **extra_kw)

    wrapper.__signature__ = Signature(
        list(sel_sig.parameters.values()) + wrapped_kwonly_params)
    return wrapper
102147
def from_value(value):
        
        if isinstance(value, PagingParams):
            return value
        if isinstance(value, AnyValueMap):
            return PagingParams.from_map(value)
        
        map = AnyValueMap.from_value(value)
        return PagingParams.from_map(map)
572899
def takes_parameters(count):
    """"""
    def decorator(f):
        """Decorate the supplied function with the "takes_parameters" logic."""
        @wraps(f)
        def wrapper(filter_operation_info, location, context, parameters, *args, **kwargs):
            """Check that the supplied number of parameters equals the expected number."""
            if len(parameters) != count:
                raise GraphQLCompilationError(u'Incorrect number of parameters, expected {} got '
                                              u'{}: {}'.format(count, len(parameters), parameters))

            return f(filter_operation_info, location, context, parameters, *args, **kwargs)

        return wrapper

    return decorator
1091235
def accepts_valid_urls(func):
    
    @functools.wraps(func)
    def wrapper(obj, urls, *args, **kwargs):
        """Run the function and return a value for valid URLs.

        :param obj: an object in whose class f is defined
        :param urls: an iterable containing URLs
        :returns: a return value of the function f
        :raises InvalidURLError: if the iterable contains invalid URLs
        """
        invalid_urls = [u for u in urls if not is_valid_url(u)]
        if invalid_urls:
            msg_tpl = 'The values: {} are not valid URLs'
            msg = msg_tpl.format(','.join(invalid_urls))
            raise InvalidURLError(msg)
        return func(obj, urls, *args, **kwargs)
    return wrapper
262022
function(value, attr, fn, model, computed) {
        if(_.isString(fn)){
          fn = model[fn];
        }
        return fn.call(model, value, attr, computed);
      }
335194
function ( parser, params ) {
		var property, funcName, values;
		for ( property in params ) {
			funcName = 'set' + property.substring( 0, 1 ).toLocaleUpperCase() + property.substring( 1 );
			values = params[ property ];

			if ( typeof parser[ funcName ] === 'function' ) {

				parser[ funcName ]( values );

			} else if ( parser.hasOwnProperty( property ) ) {

				parser[ property ] = values;

			}
		}
	}
80674
function parameterize(values, notSetValue) {
    if (typeof values === 'function') {
      return this.parameter(values);
    }
    values = Array.isArray(values) ? values : [values];
    var str = '',
        i = -1;
    while (++i < values.length) {
      if (i > 0) {
        str += ', ';
      }
      str += this.parameter(values[i] === undefined ? notSetValue : values[i]);
    }
    return str;
  }
886498
def nullify(function):
    ""
    def wrapper(*args, **kwargs):
        value = function(*args, **kwargs)
        if(type(value) == list and len(value) == 0):
            return None
        return value
    return wrapper
954528
function decorator(fn) {
	return opt => (
		typeof opt==='function' ? fn(opt) : (target, key, desc) => {
			desc.value = fn(desc.value, opt, target, key, desc);
		}
	);
}
574333
def wrap(cls, value):
        ''' 

        '''
        if isinstance(value, dict):
            if isinstance(value, PropertyValueDict):
                return value
            else:
                return PropertyValueDict(value)
        else:
            return value