Adds a type function to the backing
@param typeName
@param funcName
@param func
@returns {addTypeFunction}
333241
function addTypeFunction (typeName, funcName, func) {
  if (!stringValue(typeName)) {
    throw new Error('Invalid "typeName" argument, must be String')
  } else if (!_.isFunction(func) && !stringValue(func)) {
    throw new Error('Invalid func argument, must be function')
  }
  _.set(this.backing, [ typeName, `_${funcName}` ], func)
  return this
}
381707
public function addFunction($type, $name, callable $function)
    {

        $this->appendToArrayOrCallForEachAlias($type, function() use ($type, $name, $function){
            $this->customFunctions[$type][$name] = $function;
        }, function($target) use ( $function, $name){
            $this->addFunction($target, $name, $function);
        });

    }
1034065
public FunctionType createFunctionType(
      JSType returnType, JSType... parameterTypes) {
    return createFunctionType(returnType, createParameters(parameterTypes));
  }
869994
def create_function(self, func, name=None, database=None):
        
        if name is None:
            name = func.name
        database = database or self.current_database

        if isinstance(func, udf.ImpalaUDF):
            stmt = ddl.CreateUDF(func, name=name, database=database)
        elif isinstance(func, udf.ImpalaUDA):
            stmt = ddl.CreateUDA(func, name=name, database=database)
        else:
            raise TypeError(func)
        self._execute(stmt)
692248
public static AbstractType<?> getTypeByFunction(String functionName)
    {
        Function function;

        try
        {
            function = Function.valueOf(functionName.toUpperCase());
        }
        catch (IllegalArgumentException e)
        {
            String message = String.format("Function '%s' not found. Available functions: %s", functionName, Function.getFunctionNames());
            throw new RuntimeException(message, e);
        }

        return function.getValidator();
    }
914352
public void toSelf(def<T> func) {
                $(array).forEach((e, i) -> {
                        array[$(i)] = func.apply(e);
                });
        }
208448
function (obj, type, func) {
    if (!obj || !type || !func) return false;
    obj.funcCache = obj.funcCache || {};
    obj.funcCache[type] = func;
    if (obj.addEventListener) obj.addEventListener(type, func, false);
    else obj.attachEvent("on" + type, func);
  }
466986
function addType(typeName, type) {
	if (types[typeName]) {
		throw new Error("Type already registered '" + typeName + "'");
	}
	types[typeName] = type;
}
359939
def add_callback(self, func):
        
        if func is None: return
        func_list = to_list(func)

        if not hasattr(self, 'callback_list'):
            self.callback_list = func_list
        else:
            self.callback_list.extend(func_list)
190615
function(/* funs */) {
      var funs = arguments;

      return function(/* args */) {
        var args = arguments;
        return _.map(funs, function(f) {
          return f.apply(this, args);
        }, this);
      };
    }
872622
def annotations_func(func):
    
    if not has_type_hints(func):
        # What about defaults?
        func.__annotations__ =  {}
    func.__annotations__ = _get_type_hints(func,
            infer_defaults = False)
    return func
833730
def copy_func(f, name=None):
    """"""
    '''
    return a function with same code, globals, defaults, closure, and 
    name (or provide a new name)
    '''
    fn = types.FunctionType(f.__code__, f.__globals__, name or f.__name__,
                            f.__defaults__, f.__closure__)
    # in case f was given attrs (note this dict is a shallow copy):
    fn.__dict__.update(f.__dict__)
    return fn
1233961
def serialize_func_name(func):
    
    if func.__module__ == '__main__':
        raise ValueError('Functions from the __main__ module cannot be '
                         'processed by workers.')
    try:
        # This will only work on Python 3.3 or above, but it will allow us to use static/classmethods
        func_name = func.__qualname__
    except AttributeError:
        func_name = func.__name__
    return ':'.join([func.__module__, func_name])
452963
function wrap(func) {
  if (!util.is('Function', func)) { func = function noop(){}; }

  return function wrapper() {
    try {
      return func.apply(this, arguments);
    } catch(err) {
      this.notify(err, {stackShift: 3});
      throw(err);
    }
  }.bind(this);
}
426417
def add_function(self, function):
        
        function = self.build_function(function)
        if function.name in self.functions:
            raise FunctionAlreadyRegistered(function.name)
        self.functions[function.name] = function
1024780
def add_returning_function(self, func_addr):
        

        self._returning_functions.add(func_addr)
        self._updated_functions.add(func_addr)
551309
def decorate(self, func):
		
		self.func = func
		self._set_implied_name()
		self.register()
		return func