internal use functions
978869
function(k) {
                if (typeof k !== "string"){ k = _.stringify(k); }
                return this._ns ? this._ns + k : k;
            }
814109
function func(schema, defaults, options) {
  if (kindOf(schema) !== 'function') {
    if (process.env.NODE_ENV !== 'production') {
      throw new Error(
        `Function structs must be defined as a function, but you passed: ${schema}`
      )
    } else {
      throw new Error(`Invalid schema: ${schema}`)
    }
  }

  const name = 'function'
  const type = '<function>'
  const validate = (value = resolveDefaults(defaults), data) => {
    const result = schema(value, data)
    let failure = { path: [], reason: null }
    let isValid

    switch (kindOf(result)) {
      case 'boolean': {
        isValid = result
        break
      }
      case 'string': {
        isValid = false
        failure.reason = result
        break
      }
      case 'object': {
        isValid = false
        failure = { ...failure, ...result }
        break
      }
      default: {
        if (process.env.NODE_ENV !== 'production') {
          throw new Error(
            `Validator functions must return a boolean, an error reason string or an error reason object, but you passed: ${schema}`
          )
        } else {
          throw new Error(`Invalid result: ${result}`)
        }
      }
    }

    return isValid
      ? [undefined, value]
      : [{ type, value, data: value, ...failure }]
  }

  return new Kind(name, type, validate)
}
1281205
def _determine_uses(self, included_files, forward_declarations):
        """"""
        file_uses = dict.fromkeys(included_files, UNUSED)
        decl_uses = dict.fromkeys(forward_declarations, UNUSED)
        symbol_table = self.symbol_table

        for name, node in forward_declarations.items():
            try:
                symbol_table.lookup_symbol(node.name, node.namespace)
                decl_uses[name] |= USES_REFERENCE
            except symbols.Error:
                module = Module(name, None)
                symbol_table.add_symbol(node.name, node.namespace, node,
                                        module)

        def _do_lookup(name, namespace):
            try:
                file_use_node = symbol_table.lookup_symbol(name, namespace)
            except symbols.Error:
                return
            name = file_use_node[1].filename
            file_uses[name] = file_uses.get(name, 0) | USES_DECLARATION

        def _add_declaration(name, namespace):
            if not name:
                # Ignore anonymous struct. It is not standard, but we might as
                # well avoid crashing if it is easy.
                return

            names = [n for n in namespace if n is not None]
            if names:
                name = '::'.join(names) + '::' + name
            if name in decl_uses:
                decl_uses[name] |= USES_DECLARATION

        def _add_reference(name, namespace):
            try:
                file_use_node = symbol_table.lookup_symbol(name, namespace)
            except symbols.Error:
                return

            name = file_use_node[1].filename
            if file_use_node[1].ast_list is None:
                decl_uses[name] |= USES_REFERENCE
            elif name in file_uses:
                # enum and typedef can't be forward declared
                if isinstance(file_use_node[0], (ast.Enum, ast.Typedef)):
                    file_uses[name] |= USES_DECLARATION
                else:
                    file_uses[name] |= USES_REFERENCE

        def _add_use(node, namespace, name=''):
            if isinstance(node, basestring):
                name = node
            elif isinstance(node, list):
                # name contains a list of tokens.
                name = '::'.join([n.name for n in name])

            # node is a Type so look for its symbol immediately.
            if name:
                _do_lookup(name, namespace)
                return

            # Try to search for the value of the variable declaration for any
            # symbols, such as `#define` values or other variable names which
            # may be included in other files.
            obj = getattr(node, 'initial_value', None)
            if obj:
                _do_lookup(obj, namespace)

            # If node is a VariableDeclaration, check if the variable type is
            # a symbol used in other includes.
            obj = getattr(node, 'type', None)
            if obj and isinstance(obj.name, basestring):
                _do_lookup(obj.name, namespace)

            if not isinstance(node, basestring):
                # Happens when variables are defined with inlined types, e.g.:
                #   enum {...} variable;
                return

        def _add_variable(node, namespace, reference=False):
            obj = node.type if isinstance(
                node, ast.VariableDeclaration) else node

            if obj.reference or obj.pointer or reference:
                _add_reference(obj.name, namespace)
            else:
                # Add a use for the variable declaration type as well as the
                # variable value.
                _add_use(obj.name, namespace)
                _add_use(node, namespace)
            # This needs to recurse when the node is a templated type.
            _add_template_use(obj.name,
                              obj.templated_types,
                              namespace,
                              reference)

        def _process_function(function, namespace):
            reference = function.body is None
            if function.return_type:
                return_type = function.return_type
                _add_variable(return_type, namespace, reference)

            for s in function.specializations:
                _add_variable(s, namespace, not function.body)

            templated_types = function.templated_types or ()
            for p in function.parameters:
                node = p.type
                if node.name not in templated_types:
                    if function.body and p.name:
                        # Assume that if the function has a body and a name
                        # the parameter type is really used.
                        # NOTE(nnorwitz): this is over-aggressive. It would be
                        # better to iterate through the body and determine
                        # actual uses based on local vars and data members
                        # used.
                        _add_use(node.name, namespace)
                    elif (
                        p.default and
                        p.default[0].name != '0' and
                        p.default[0].name != 'NULL' and
                        p.default[0].name != 'nullptr'
                    ):
                        _add_use(node.name, namespace)
                    elif node.reference or node.pointer or reference:
                        _add_reference(node.name, namespace)
                    else:
                        _add_use(node.name, namespace)
                    _add_template_use(node.name,
                                      node.templated_types,
                                      namespace,
                                      reference)

        def _process_function_body(function, namespace):
            previous = None
            save = namespace[:]
            for t in function.body:
                if t.token_type == tokenize.NAME:
                    previous = t
                    if not keywords.is_keyword(t.name):
                        # TODO(nnorwitz): handle static function calls.
                        # TODO(nnorwitz): handle using statements in file.
                        # TODO(nnorwitz): handle using statements in function.
                        # TODO(nnorwitz): handle namespace assignment in file.
                        _add_use(t.name, namespace)
                elif t.name == '::' and previous is not None:
                    namespace.append(previous.name)
                elif t.name in (':', ';'):
                    namespace = save[:]

        def _add_template_use(name, types, namespace, reference=False):
            for cls in types or ():
                if cls.pointer or cls.reference or reference:
                    _add_reference(cls.name, namespace)
                elif name.endswith('_ptr'):
                    # Special case templated classes that end w/_ptr.
                    # These are things like auto_ptr which do
                    # not require the class definition, only decl.
                    _add_reference(cls.name, namespace)
                elif name.startswith('Q') and name.endswith('Pointer'):
                    # Special case templated classes from the Qt framework.
                    _add_reference(cls.name, namespace)
                else:
                    _add_use(cls.name, namespace)
                _add_template_use(cls.name, cls.templated_types,
                                  namespace, reference)

        def _process_types(nodes, namespace):
            for node in nodes:
                if isinstance(node, ast.Type):
                    _add_variable(node, namespace)

        # Iterate through the source AST/tokens, marking each symbols use.
        ast_seq = [self.ast_list]
        namespace_stack = []
        while ast_seq:
            for node in ast_seq.pop():
                if isinstance(node, ast.VariableDeclaration):
                    namespace = namespace_stack + node.namespace
                    _add_variable(node, namespace)
                elif isinstance(node, ast.Function):
                    namespace = namespace_stack + node.namespace
                    _process_function(node, namespace)
                    if node.body:
                        _process_function_body(node, namespace)
                elif isinstance(node, ast.Typedef):
                    namespace = namespace_stack + node.namespace
                    _process_types(node.alias, namespace)
                elif isinstance(node, ast.Friend):
                    expr = node.expr
                    namespace = namespace_stack + node.namespace
                    if isinstance(expr, ast.Type):
                        _add_reference(expr.name, namespace)
                    elif isinstance(expr, ast.Function):
                        _process_function(expr, namespace)
                elif isinstance(node, ast.Union) and node.body is not None:
                    ast_seq.append(node.body)
                elif isinstance(node, ast.Class) and node.body is not None:
                    _add_declaration(node.name, node.namespace)
                    namespace = namespace_stack + node.namespace
                    _add_template_use('', node.bases, namespace)
                    ast_seq.append(node.body)
                elif isinstance(node, ast.Using):
                    if node.names[0].name == 'namespace':
                        namespace_stack.append(node.names[1].name)

        return file_uses, decl_uses
1344891
function errHandler(err, req, res, next) {
  console.log(addTimestamp("Internal error: " + util.inspect(err)));
  console.error(addTimestamp("Internal error: " + util.inspect(err)));
  if (err && err.stack) {
    console.error(err.stack);
  }

  var errorMessage = {
    msg: 'Internal error: ' + util.inspect(err),
    error: util.inspect(err)
  };
  if (res) {
    res.statusCode = 500;
    res.end(JSON.stringify(errorMessage));
  }

  return errorMessage;
}
473722
def get_used_in_func(node):
    '''
    '''
    if isinstance(node, ast.FunctionDef):
        return {node.name: get_accessed(node.body)}
    names = {}
    for node in ast.iter_child_nodes(node):
        names.update(get_used_in_func(node))
    return names
555320
function DumpInternals() {
    for (let ck in exports.globalKCState.controllers) {
        console.log("============================================");
        console.log(`Controller on path ${exports.globalKCState.controllers[ck].path} built from Class ${exports.globalKCState.controllers[ck].ctr.name}`);
        console.log("With Methods:");
        for (let mk in exports.globalKCState.controllers[ck].methods) {
            let m = exports.globalKCState.controllers[ck].methods[mk];
            console.log(`== ${mk} ==`);
            console.log(m);
            console.log("");
        }
    }
}
416240
function internalRewire(parentModulePath, targetPath) {
    var targetModule,
        prelude,
        appendix,
        src;

    // Checking params
    if (typeof targetPath !== "string") {
        throw new TypeError("Filename must be a string");
    }

    // Resolve full filename relative to the parent module
    targetPath = Module._resolveFilename(targetPath, parentModulePath);

    // Create testModule as it would be created by require()
    targetModule = new Module(targetPath, parentModulePath);

    // We prepend a list of all globals declared with var so they can be overridden (without changing original globals)
    prelude = getImportGlobalsSrc();

    // Wrap module src inside IIFE so that function declarations do not clash with global variables
    // @see https://github.com/jhnns/rewire/issues/56
    prelude += "(function () { ";

    // We append our special setter and getter.
    appendix = "\n" + getDefinePropertySrc();

    // End of IIFE
    appendix += "})();";

    // Check if the module uses the strict mode.
    // If so we must ensure that "use strict"; stays at the beginning of the module.
    src = fs.readFileSync(targetPath, "utf8");
    if (detectStrictMode(src) === true) {
        prelude = ' "use strict"; ' + prelude;
    }

    moduleEnv.inject(prelude, appendix);
    moduleEnv.load(targetModule);

    return targetModule.exports;
}
556945
function process( $tpl, &$textElements, $functionName, $functionChildren, $functionParameters, $functionPlacement, $rootNamespace, $currentNamespace )
    {
        $params = $functionParameters;
        switch ( $functionName )
        {
            case $this->BlockName:
            {
                $viewMode = "full";
                $name = $currentNamespace;
                // Read ini file
                $toolbarIni = eZINI::instance( "toolbar.ini" );

                if ( isset( $functionParameters["view"] ) )
                {
                    $viewMode = $tpl->elementValue( $functionParameters["view"], $rootNamespace, $currentNamespace, $functionPlacement );
                }

                if ( isset( $functionParameters["name"] ) )
                {
                    reset( $params );
                    $whatParamsShouldBeUnset = array();
                    $whatParamsShouldBeReplaced = array();
                    while ( ( $key = key( $params ) ) !== null )
                    {
                        $item =& $params[$key];
                        switch ( $key )
                        {
                            case "name":
                            case "view":
                                break;

                            default:
                            {
                                if ( !$tpl->hasVariable( $key, $name ) )
                                {
                                    $whatParamsShouldBeUnset[] = $key; // Tpl vars should be removed after including
                                }
                                else
                                {
                                    $whatParamsShouldBeReplaced[$key] = $tpl->variable( $key, $name ); // Tpl vars should be replaced after including
                                }

                                $item_value = $tpl->elementValue( $item, $rootNamespace, $currentNamespace, $functionPlacement );
                                $tpl->setVariable( $key, $item_value, $name );
                            } break;
                        }
                        next( $params );
                    }
                    $toolbarPosition = $tpl->elementValue( $functionParameters["name"], $rootNamespace, $currentNamespace, $functionPlacement );
                    $definedVariables = array();
                    $toolbarName = "Toolbar_" . $toolbarPosition;
                    $toolArray = $toolbarIni->variable( $toolbarName, 'Tool' );

                    if ( !is_array( $toolArray ) )
                        $toolArray = array();

                    $actionParameters = array();
                    foreach ( array_keys( $toolArray ) as $toolKey )
                    {
                        $definedVariables = array();
                        $tool = $toolArray[$toolKey];
                        $placement = $toolKey + 1;
                        if ( $toolbarIni->hasGroup( "Tool_" . $tool ) )
                        {
                            $actionParameters = $toolbarIni->group( "Tool_" . $tool );
                        }
                        if ( $toolbarIni->hasGroup( "Tool_" . $toolbarPosition . "_" . $tool . "_" . $placement ) )
                        {
                            $actionParameters = array_merge( $actionParameters, $toolbarIni->group( "Tool_" . $toolbarPosition . "_" . $tool . "_" . $placement ) );
                        }
                        foreach ( array_keys( $actionParameters ) as $key )
                        {
                            $itemValue = $actionParameters[$key];
                            $tpl->setVariable( $key, $itemValue, $name );
                            $definedVariables[] = $key;
                        }
                        $toolIDValue =  "Tool_" . $toolbarPosition . "_" . $tool . "_" . $placement;
                        $tpl->setVariable( "tool_id", $toolIDValue, $name );
                        $definedVariables[] = "tool_id";
                        $toolOffset = $placement;
                        $tpl->setVariable( "offset", $toolOffset, $name );
                        $definedVariables[] = "offset";
                        $uri = "design:toolbar/$viewMode/$tool.tpl";

                        if ( $placement == 1 )
                        {
                            if ( count( $toolArray ) == 1 )
                            {
                                $tpl->setVariable( "first", true );
                                $tpl->setVariable( "last", true );
                                $tpl->setVariable( "placement", "last" );
                                $definedVariables[] = "first";
                                $definedVariables[] = "last";
                                $definedVariables[] = "placement";
                            }
                            else
                            {
                                $tpl->setVariable( "first", true );
                                $tpl->setVariable( "last", false );
                                $tpl->setVariable( "placement", "first" );
                                $definedVariables[] = "first";
                                $definedVariables[] = "last";
                                $definedVariables[] = "placement";
                            }
                        }
                        else if ( $placement == count( $toolArray ) )
                        {
                            $tpl->setVariable( "first", false );
                            $tpl->setVariable( "last", true );
                            $tpl->setVariable( "placement", "last" );
                            $definedVariables[] = "first";
                            $definedVariables[] = "last";
                            $definedVariables[] = "placement";
                        }
                        else
                        {
                            $tpl->setVariable( "first", false );
                            $tpl->setVariable( "last",  false );
                            $tpl->setVariable( "placement", "" );
                            $definedVariables[] = "placement";
                        }
                        $tpl->processURI( $uri, true, $extraParameters, $textElements, $name, $name );
                        // unset var
                        foreach ( $whatParamsShouldBeUnset as $key )
                        {
                            $tpl->unsetVariable( $key, $name );
                        }
                        // replace var
                        foreach ( $whatParamsShouldBeReplaced as $key => $item_value )
                        {
                            $tpl->setVariable( $key, $item_value, $name );
                        }
                    }
                }
            }
        }
    }
1261298
def _at_dump_functions(self, calculator, rule, scope, block):
        
        sys.stderr.write("%s\n" % repr(rule.namespace._functions))
927955
private function createInternalClasses()
    {
        \danog\MadelineProto\Logger::log('Creating internal classes...', \danog\MadelineProto\Logger::NOTICE);
        $handle = fopen(dirname(__FILE__).'/InternalDoc.php', 'w');
        foreach ($this->methods->by_id as $id => $data) {
            if (!strpos($data['method'], '.')) {
                continue;
            }
            list($namespace, $method) = explode('.', $data['method']);
            if (!in_array($namespace, $this->get_method_namespaces())) {
                continue;
            }
            $type = str_replace(['.', '<', '>'], ['_', '_of_', ''], $data['type']);
            foreach ($data['params'] as $param) {
                if (in_array($param['name'], ['flags', 'random_id'])) {
                    continue;
                }
                $stype = 'type';
                if (isset($param['subtype'])) {
                    $stype = 'subtype';
                }
                $ptype = str_replace('.', '_', $param[$stype]);
                switch ($ptype) {
                    case 'true':
                    case 'false':
                        $ptype = 'boolean';
                }
                $internalDoc[$namespace][$method]['attr'][$param['name']] = $ptype;
            }
            if ($type === 'Bool') {
                $type = strtolower($type);
            }
            $internalDoc[$namespace][$method]['return'] = $type;
        }
        fwrite($handle, "<?php\n");
        fwrite($handle, "/**\n");
        fwrite($handle, " * This file is automatic generated by build_docs.php file\n");
        fwrite($handle, " * and is used only for autocomplete in multiple IDE\n");
        fwrite($handle, " * don't modify manually.\n");
        fwrite($handle, " */\n\n");
        fwrite($handle, "namespace danog\\MadelineProto;\n");
        foreach ($internalDoc as $namespace => $methods) {
            fwrite($handle, "\ninterface {$namespace}\n{");
            foreach ($methods as $method => $properties) {
                fwrite($handle, "\n    /**\n");
                if (isset($properties['attr'])) {
                    fwrite($handle, "     * @param array params [\n");
                    foreach ($properties['attr'] as $name => $type) {
                        fwrite($handle, "     *               {$type} {$name},\n");
                    }
                    fwrite($handle, "     *              ]\n");
                    fwrite($handle, "     *\n");
                }
                fwrite($handle, "     * @return {$properties['return']}\n");
                fwrite($handle, "     */\n");
                fwrite($handle, "    public function {$method}(");
                if (isset($properties['attr'])) {
                    fwrite($handle, 'array $params');
                }
                fwrite($handle, ");\n");
            }
            fwrite($handle, "}\n");
        }
        fclose($handle);
    }
48004
function T(iid, val, type, hasGetterSetter, internalIid) {
        var aret;
        associateSidWithFunction(val, internalIid);
        if (hasGetterSetter) {
            for (var offset in val) {
                if (hasGetOwnPropertyDescriptor && val.hasOwnProperty(offset)) {
                    var desc = Object.getOwnPropertyDescriptor(val, offset);
                    if (desc !== undefined) {
                        if (typeof desc.get === 'function') {
                            T(iid, desc.get, 12, false, internalIid);
                        }
                        if (typeof desc.set === 'function') {
                            T(iid, desc.set, 12, false, internalIid);
                        }
                    }
                }
            }
        }
        if (sandbox.analysis && sandbox.analysis.literal) {
            aret = sandbox.analysis.literal(iid, val, hasGetterSetter);
            if (aret) {
                val = aret.result;
            }
        }
        return (lastComputedValue = val);
    }
877765
function unused(src) {
    var ast = esprima.parse(src, {
        loc: true
    });

    // map of identifiers -> location
    // when an identifier is seen, it is removed from the map
    var unused_vars = [];

    function exec(node, context) {
        if (!node) {
            return;
        }

        handlers[node.type](node, context);
    };

    function maybe_set_id(id, context, is_param) {
        if (!id) {
            return;
        }

        if (id.type !== 'Identifier') {
            exec(id, context);
            return;
        }

        context.set(id.name, {
            name: id.name,
            loc: id.loc.start,
            param: is_param || false
        });
    }

    function maybe_set_param(id, context) {
        maybe_set_id(id, context, true);
    }

    var handlers = {
        VariableDeclaration: function(node, context) {
            node.declarations.forEach(function(node) {
                exec(node, context)
            });
        },
        VariableDeclarator: function(node, context) {
            maybe_set_id(node.id, context);
            exec(node.init, context);
        },
        FunctionExpression: function(node, context) {
            // function express ids are ignored
            // assume user specified it for backtrace reasons

            var ctx = new Context(context);

            // parameters are within the context of the function
            node.params.forEach(function(node) {
                maybe_set_param(node, ctx);
            });

            // exec function body with new context
            exec(node.body, ctx);

            Array.prototype.push.apply(unused_vars, ctx.unused());
        },
        FunctionDeclaration: function(node, context) {
            maybe_set_id(node.id, context);

            var ctx = new Context(context);

            // parameters are within the context of the function
            node.params.forEach(function(node) {
                maybe_set_param(node, ctx);
            });

            // exec function body with new context
            exec(node.body, ctx);

            Array.prototype.push.apply(unused_vars, ctx.unused());
        },
        BlockStatement: function(node, context) {
            node.body.forEach(function(node) {
                exec(node, context);
            });
        },
        CallExpression: function(node, context) {
            exec(node.callee, context);

            node.arguments.forEach(function(node) {
                exec(node, context);
            });
        },
        MemberExpression: function(node, context) {
            exec(node.object, context);
            exec(node.property, context);
        },
        ExpressionStatement: function(node, context) {
            exec(node.expression, context);
        },
        ObjectExpression: function(node, context) {
            node.properties.forEach(function(node) {
                exec(node, context);
            });
        },
        AssignmentExpression: function(node, context) {
            exec(node.left, context);
            exec(node.right, context);
        },
        LogicalExpression: function(node, context) {
            exec(node.left, context);
            exec(node.right, context);
        },
        BinaryExpression: function(node, context) {
            exec(node.left, context);
            exec(node.right, context);
        },
        TryStatement: function(node, context) {
            node.block.body.forEach(function(node) {
                exec(node, context);
            });

            node.handlers.forEach(function(node) {
                exec(node, context);
            });
        },
        CatchClause: function(node, context) {
            exec(node.param, context);
            exec(node.body, context);
        },
        ConditionalExpression: function(node, context) {
            exec(node.test, context);
            exec(node.consequent, context);
            exec(node.alternate, context);
        },
        ArrayExpression: function(node, context) {
            node.elements.forEach(function(node) {
                exec(node, context);
            });
        },
        UpdateExpression: function(node, context) {
            exec(node.argument, context);
        },
        UnaryExpression: function(node, context) {
            exec(node.argument, context);
        },
        ThrowStatement: function(node, context) {
            exec(node.argument, context);
        },
        IfStatement: function(node, context) {
            exec(node.test, context);
            exec(node.consequent, context);
            exec(node.alternate, context);
        },
        ReturnStatement: function(node, context) {
            exec(node.argument, context);
        },
        SwitchStatement: function(node, context) {
            exec(node.discriminant, context);
            node.cases.forEach(function(node) {
                exec(node, context);
            });
        },
        SwitchCase: function(node, context) {
            exec(node.test, context);
            node.consequent.forEach(function(node) {
                exec(node, context);
            });
        },
        NewExpression: function(node, context) {
            exec(node.callee, context);
            node.arguments.forEach(function(node) {
                exec(node, context);
            });
        },
        Property: function(node, context) {
            exec(node.key, context);
            exec(node.value, context);
        },
        ForInStatement: function(node, context) {
            exec(node.left, context);
            exec(node.right, context);
            exec(node.body, context);
        },
        WhileStatement: function(node, context) {
            exec(node.test, context);
            exec(node.body, context);
        },
        SequenceExpression: function(node, context) {
            node.expressions.forEach(function(node) {
                exec(node, context);
            });
        },
        ForStatement: function(node, context) {
            exec(node.init, context);
            exec(node.test, context);
            exec(node.update, context);
            exec(node.body, context);
        },
        DoWhileStatement: function(node, context) {
            exec(node.body, context);
            exec(node.test, context);
        },
        ContinueStatement: function() {
        },
        BreakStatement: function() {
        },
        ThisExpression: function() {
        },
        EmptyStatement: function() {
        },
        Literal: function() {
        },
        Identifier: function(node, context) {
            context.remove(node.name);
        },
    };

    // TODO handle the case where use of a variable comes before declaring it
    // while this seems retarded, javascript does allow it

    var body = ast.body;

    var ctx = new Context();

    body.forEach(function(node) {
        exec(node, ctx);
    });

    Array.prototype.push.apply(unused_vars, ctx.unused());

    return unused_vars;
}
1186052
void transform_internal (double data[], int i0, int stride, int direction) {
    if (decimate==DECINFREQ) {
      transform_DIF(data,i0,stride,direction); }
    else {
      transform_DIT(data,i0,stride,direction); }}
263185
function use(that, scope, plugin, options) {

  // if it's a string then it's either a package name or a script path.
  if (typeof plugin === 'string') {

    // use our scope's load() (so it can be overridden)
    plugin = scope.load(plugin, options)

    if (plugin.error != null) {
      return plugin
    }
  }

  // otherwise, it should be a function, if not, return an error.
  if (typeof plugin !== 'function') {
    return {
      error: 'plugin must be a function'
    }
  }

  // it is a function so call it and return the result (may be an error).
  return plugin.call(that, options, that)
}
1018982
function stringInterner() { // eslint-disable-line no-unused-vars
  const strings = [];
  const ids = {};
  return {
    intern: function internString(s) {
      const find = ids[s];
      if (find === undefined) {
        const id = strings.length;
        ids[s] = id;
        strings.push(s);
        return id;
      } else {
        return find;
      }
    },
    get: function getString(id) {
      return strings[id];
    },
  };
}
704292
function _fnSetCellData( oSettings, iRow, iCol, val )
		{
			var oCol = oSettings.aoColumns[iCol];
			var oData = oSettings.aoData[iRow]._aData;
		
			oCol.fnSetData( oData, val );
		}
103349
void internalAddChange(String valuePath, String attributeName, int valueIndex, ChangeType changeType) {

        m_changeTimer = null;
        //TODO: keep the IDs, otherwise redo will not work
        CmsEntity currentData = m_entity.cloneEntity();
        if (!currentData.equals(m_current.getEntityData())) {
            m_undo.push(m_current);
            m_current = new Change(currentData, valuePath, attributeName, valueIndex, changeType);
            m_redo.clear();
            fireStateChange();
        }
    }