Function to abstract
490874
def delete_host_from_segment(ipaddress, networkaddress, auth, url):
    '''

    '''
    host_id = get_host_id(ipaddress, networkaddress, auth, url)
    remove_scope_ip(host_id, auth.creds, auth.url)
101585
function parseAbstracts(abstracts, constructor) {
        var optsStatic = { isStatic: true },
            key,
            value,
            unallowed;

        // Check argument
        if (!isObject(abstracts)) {
            throw new Error('$abstracts defined in abstract class "' + constructor.prototype.$name + '" must be an object.');
        }

        // Check reserved keywords
        checkKeywords(abstracts);

        // Check unallowed keywords
        unallowed = testKeywords(abstracts, ['$statics']);
        if (unallowed) {
            throw new Error('$statics inside $abstracts of abstract class "' + constructor.prototype.$name + '" contains an unallowed keyword: "' + unallowed + '".');
        }

        if (hasOwn(abstracts, '$statics')) {
            // Check argument
            if (!isObject(abstracts.$statics)) {
                throw new Error('$statics definition in $abstracts of abstract class "' + constructor.prototype.$name + '" must be an object.');
            }

            // Check keywords
            checkKeywords(abstracts.$statics, 'statics');

            // Check unallowed keywords
            unallowed = testKeywords(abstracts.$statics);
            if (unallowed) {
                throw new Error('$statics inside $abstracts of abstract class "' + constructor.prototype.$name + '" contains an unallowed keyword: "' + unallowed + '".');
            }

            for (key in abstracts.$statics) {
                value = abstracts.$statics[key];

                // Check if it is not a function
                if (!isFunction(value) || value[$interface] || value[$class]) {
                    throw new Error('Abstract member "' + key + '" found in abstract class "' + constructor.prototype.$name + '" is not a function.');
                }

                addMethod(key, value, constructor, optsStatic);
            }

            delete abstracts.$statics;
        }

        for (key in abstracts) {
            value = abstracts[key];

            // Check if it is not a function
            if (!isFunction(value) || value[$interface] || value[$class]) {
                throw new Error('Abstract member "' + key + '" found in abstract class "' + constructor.prototype.$name + '" is not a function.');
            }

            addMethod(key, value, constructor);
        }
    }
847270
function vectorize(fun) {
  return function(x) {
    if (!isArray(x)) {
      return fun(x);
    }
    return x.map(function(x) {
      return fun(x);
    });
  };
}
119004
function baseMapArgs (fun, mapFun) {
    return _.arity(fun.length, function () {
      return fun.apply(this, __map.call(arguments, mapFun));
    });
  }
881752
function Function_(types) {
    var tuples = Z.reduce (function(tuples, t) {
      tuples.push (['$' + show (tuples.length + 1), K ([]), t]);
      return tuples;
    }, [], types);

    function format(outer, inner) {
      return when (tuples.length !== 2)
                  (parenthesize (outer))
                  (joinWith (outer (', '),
                             Z.map (function(tuple) {
                               return when (tuple[2].type === FUNCTION)
                                           (parenthesize (outer))
                                           (inner (tuple[0])
                                                  (show (tuple[2])));
                             }, init (tuples)))) +
             outer (' -> ') +
             inner ((last (tuples))[0])
                   (show ((last (tuples))[2]));
    }

    return _Type (FUNCTION,
                  '',
                  '',
                  types.length,
                  format,
                  [AnyFunction],
                  K (K (true)),
                  tuples);
  }
1353928
def pipe_util(func):
    
    @wraps(func)
    def pipe_util_wrapper(function, *args, **kwargs):
        if isinstance(function, XObject):
            function = ~function

        original_function = function

        if args or kwargs:
            function = xpartial(function, *args, **kwargs)

        name = lambda: '%s(%s)' % (get_name(func), ', '.join(
            filter(None, (get_name(original_function), repr_args(*args, **kwargs)))))

        f = func(function)

        result = pipe | set_name(name, f)

        # if the util defines an 'attrs' mapping, copy it as attributes
        # to the result
        attrs = getattr(f, 'attrs', {})
        for k, v in dict_items(attrs):
            setattr(result, k, v)

        return result

    return pipe_util_wrapper
234077
function addExtras( currentObj, baseObj, fn ) {
			// Return function name.
			var clss = currentObj.getClass();
			for ( var k in currentObj) {
				if (currentObj.hasOwnProperty(k) && typeof currentObj[k] == 'function' && k != fn) {
					currentObj[k] = currentObj[k].bind(currentObj);
					currentObj[k].$name = k;
					currentObj[k].$Class = clss;
				}
			}

			addInstance(currentObj);

			// eachPropertyOf(currentObj.Private, function(val, key){
			if (currentObj.Private && typeof currentObj.Private[fn] == 'function') {
				currentObj[fn] = currentObj.Private[fn];
			}
			if (currentObj[fn]) {
				currentObj[fn].$Class = currentObj.getClass();
				currentObj[fn].$name = fn;
			}
			// Check if function have constant.
			if (currentObj.Const) {
				var cnt = currentObj.Const;
				delete cnt.Static;
				for (k in cnt) {
					cnt.hasOwnProperty(k) && currentObj.$add(currentObj, k, cnt[k], true);
				}
			}
			// migrate information about abstract method to base class.
			if (currentObj.isAbstract) {
				var absMethods = currentObj.prototype.$get("Abstract");
				currentObj.setAbstractMethods = function( solidObj ) {
					for ( var k in absMethods) {
						if (absMethods.hasOwnProperty(k)) {
							if (typeof solidObj[k] != 'function') {
								throw "Abstract method " + k + " is not implemented by " + solidObj.getClass();
							}
							this[k] = solidObj[k];
						}
					}
					if (baseObj && baseObj.prototype.isAbstract) {
						baseObj.prototype.setAbstractMethods(solidObj);
					}
				};
			}

			if (baseObj) {
				if (baseObj.prototype.isAbstract) {
					baseObj.prototype.getSub = function( ) {
						return currentObj.isAbstract ? currentObj.getSub() : currentObj;
					};
				}
				currentObj.base = baseObj;
				baseObj.$ADD(currentObj);
			}
		}
190615
function(/* funs */) {
      var funs = arguments;

      return function(/* args */) {
        var args = arguments;
        return _.map(funs, function(f) {
          return f.apply(this, args);
        }, this);
      };
    }
1130338
def fmap(self, f: 'WrappedFunction') -> 'WrappedFunction':
        '''
            
        '''
        if not isinstance(f, WrappedFunction):
            f = WrappedFunction(f)
        return WrappedFunction(lambda *args, **kwargs: self(f(*args, **kwargs)), nargs=f.nargs, nouts=self.nouts)
175257
def map(self, func: Callable[[T], U]) -> 'TOption[T]':
        
        return self if self.is_none() else TOption(func(self.value))
1033509
function curry(fn, ...firstArgs) {
  return function(...secondArgs) {
    return fn.apply(null, firstArgs.concat(secondArgs));
  };
}
947136
public static <F, T> List<T> transform(Collection<F> fromList,
            Function<? super F, ? extends T> function) {
        if (CollectionUtil.isEmpty(fromList)) {
            return Collections.emptyList();
        }

        List<T> ret = new ArrayList<T>(fromList.size());
        for (F f : fromList) {
            T t = function.apply(f);
            if (t == null) {
                continue;
            }
            ret.add(t);
        }

        return ret;
    }
1031603
function(fs) {
        var fR = [];
        for (var key in fs) {
            var fact = fs[key];
            if(!fact.explicit) {
                fR.push(fact);
            }
        }
        return fR;
    }
927241
public <B> MonoT<W,B> flatMapT(final Function<? super T, MonoT<W,B>> f) {
        MonoT<W, B> r = of(run.map(future -> Mono.from(future.flatMap(a -> {
            Mono<B> m = f.apply(a).run.stream()
                    .toList()
                    .get(0);
            return m;
        }))));
        return r;
    }
339288
function nAry(num, fn) {
  if(!isNumber(num)) {
    throw new TypeError('nAry: Number required for first argument')
  }

  if(!isFunction(fn)) {
    throw new TypeError('nAry: Function required for second argument')
  }

  return curryN(num, fn)
}
146051
def function(self, fun, *args, **kwargs):
        '''
        
        '''
        func = self.sminion.functions[fun]
        args, kwargs = salt.minion.load_args_and_kwargs(
            func,
            salt.utils.args.parse_input(args, kwargs=kwargs),)
        return func(*args, **kwargs)
131684
def get_func(func, aliasing, implementations):
    
    try:
        func_str = aliasing[func]
    except KeyError:
        if callable(func):
            return func
    else:
        if func_str in implementations:
            return func_str
        if func_str.startswith('nan') and \
                func_str[3:] in funcs_no_separate_nan:
            raise ValueError("%s does not have a nan-version".format(func_str[3:]))
        else:
            raise NotImplementedError("No such function available")
    raise ValueError("func %s is neither a valid function string nor a "
                     "callable object".format(func))