super_fn calls the old function which was overwritten by this mixin.
1060
function super_fn() {
					if (!oldFn) { return }
					each(arguments, function(arg, i) {
						args[i] = arg
					})
					return oldFn.apply(self, args)
				}
24396
def _update_function(self, oldfunc, newfunc):
        """"""
        oldfunc.__doc__ = newfunc.__doc__
        oldfunc.__dict__.update(newfunc.__dict__)

        try:
            newfunc.__code__
            attr_name = '__code__'
        except AttributeError:
            newfunc.func_code
            attr_name = 'func_code'

        old_code = getattr(oldfunc, attr_name)
        new_code = getattr(newfunc, attr_name)
        if not code_objects_equal(old_code, new_code):
            notify_info0('Updated function code:', oldfunc)
            setattr(oldfunc, attr_name, new_code)
            self.found_change = True

        try:
            oldfunc.__defaults__ = newfunc.__defaults__
        except AttributeError:
            oldfunc.func_defaults = newfunc.func_defaults

        return oldfunc
1088119
def get_functions_overridden_by(self, function):
        '''
            

        '''
        candidates = [c.functions_not_inherited for c in self.inheritance]
        candidates = [candidate for sublist in candidates for candidate in sublist]
        return [f for f in candidates if f.full_name == function.full_name]
602147
def deprecated(message=None):
    """"""
    def deco(func):
        @functools.wraps(func)
        def wrapped(*args, **kwargs):
            warnings.warn(
                message or 'Call to deprecated function {}'.format(func.__name__),
                category=PubChemPyDeprecationWarning,
                stacklevel=2
            )
            return func(*args, **kwargs)
        return wrapped
    return deco
1246252
def _replace_by(module_function, warn=False):
    """"""
    def decorate(func, module_function=module_function, warn=warn):
        sys.path.append(os.path.dirname(__file__))
        try:
            module, function = module_function.split('.')
            func, oldfunc = getattr(__import__(module), function), func
            globals()['__old_' + func.__name__] = oldfunc
        except Exception:
            if warn:
                warnings.warn("failed to import %s" % module_function)
        sys.path.pop()
        return func

    return decorate
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
455163
public <E extends Exception> void replaceAll(Try.BiFunction<? super T, ? super Integer, Integer, E> function) throws E {
        List<T> keyToRemove = null;
        Integer newVal = null;

        for (Map.Entry<T, MutableInt> entry : this.valueMap.entrySet()) {
            newVal = function.apply(entry.getKey(), entry.getValue().value());

            if (newVal == null || newVal.intValue() <= 0) {
                if (keyToRemove == null) {
                    keyToRemove = new ArrayList<>();
                }

                keyToRemove.add(entry.getKey());
            } else {
                entry.getValue().setValue(newVal);
            }
        }

        if (N.notNullOrEmpty(keyToRemove)) {
            for (T key : keyToRemove) {
                valueMap.remove(key);
            }
        }
    }
1093959
def overrides(method):
    '''
    
    '''
    def wrapper(func):
        if func.__name__ != method.__name__:
            msg = "Wrong @override: %r expected, but overwriting %r."
            msg = msg % (func.__name__, method.__name__)
            raise AssertionError(msg)

        if func.__doc__ is None:
            func.__doc__ = method.__doc__

        return func

    return wrapper
632209
function setupEmulateDynamicDispatch (baseFn, overrideFn) {
  // If the override function does not call _super, then we need to return
  // the override function. If the base function does not exist, then we need
  // to return the override function.
  const callsBaseMethod = METHOD_CALLS_SUPER_REGEXP.test (overrideFn);

  if (!callsBaseMethod)
    return overrideFn;

  // Make sure the base method exists, even if it is a no-op method.
  baseFn = baseFn || function __baseFn () {};

  function __override () {
    let original = this._super;
    this._super = baseFn;

    // Call the method override. The override method will call _super, which
    // will call the base method.
    let ret = overrideFn.call (this, ...arguments);

    this._super = original;

    return ret;
  }

  __override.__baseMethod = baseFn;

  return __override;
}
1103135
function _mixinGenMethod(aMixinSuper, aMethod, src) {
  var oldSuper = src.__super__;
  return function() {
    // src.__super__ = aMixinSuper;
    console.error('mx', aMixinSuper, 'src', src, 'aMethod', aMethod);
    // var oldvar = getPrototypeOf(this);
    // setPrototypeOf(this, aMixinSuper);
    var result = aMethod.apply(this, arguments);
    // setPrototypeOf(this, oldvar);
    // src.__super__ = oldSuper;
    return result;
  };
}
295504
function _inherits(SubClass, SuperClass) {
	if (typeof SuperClass !== "function" && SuperClass !== null) {
		throw new TypeError("Super expression must either be null or a function, not " + typeof SuperClass);
	}
	SubClass.prototype = new SuperClass();
}
379319
function mixClone()
{
  // keep original prototype for the last argument
  var args   = Array.prototype.slice.call(arguments)
    , i      = args.length
    , output = new Function()
    , target
    ;

  while (i-- > 0)
  {
    // "clone" function
    target = copyFunction(args[i]);

    // add `output` as a prototype and __proto__
    // and promote `target` to be a prototype
    // for the next argument
    output = addSuper(target, output);
  }

  return output;
}
1215501
def change_function_style(self, stripped_record, func_decl_style):
        """"""
        if func_decl_style is None:
            return stripped_record
        if self.apply_function_style is None:
            # user does not want to enforce any specific function style
            return stripped_record
        regex = FUNCTION_STYLE_REGEX[func_decl_style]
        replacement = FUNCTION_STYLE_REPLACEMENT[self.apply_function_style]
        changed_record = re.sub(regex, replacement, stripped_record)
        return changed_record.strip()
22706
function callOnce(fn) {
  var called = false

  return calledOnceShim

  //-----------------------------------
  function calledOnceShim() {
    if (called) return
    called = true

    fn.apply(this, arguments)
  }
}
799560
def deprecated(function, instead):
    """"""

    # skip for classes, breaks doc generation
    if not isinstance(function, types.FunctionType):
        return function

    @wraps(function)
    def wrap(*args, **kwargs):
        warnings.warn("Deprecated, use %s instead" % instead,
                      PyGIDeprecationWarning)
        return function(*args, **kwargs)

    return wrap
1235435
function replaceSuperMethodCall(node, state, path, options) {
  // like super.foo()
  console.assert(node.type === "CallExpression");
  console.assert(node.callee.object.type === "Super");

  return funcCall(
            member(
              funcCall(
                member(options.functionNode, "_get"),
                replaceSuper(node.callee.object, state, path.concat(["callee", "object"]), options),
                literal(node.callee.property.value || node.callee.property.name),
                id("this")),
                "call"),
            id("this"), ...node.arguments);
}
361692
function(name) {
       if ($caller !== null) {
            for(var $s = $caller.boundTo.$parent; $s !== null; $s = $s.$parent) {
                var m = $s.prototype[name];
                if (typeof m === 'function') {
                    return m;
                }
            }
            return null;
        }
        throw new Error("$super is called outside of class context");
    }