INTERNAL FUNCTIONS
163851
private function &_getReplyQueue($forwardQueueName)
    {
        $serverId = $this->_getQueueServerId($forwardQueueName);
        $server   = &$this->servers[$serverId];
        
        $reason = self::REASON_MAIN;
        
        if (isset($server[self::SERVER_QUEUES][$reason])) {
            // пересоздаем очереди каждые 45 минут.
            if ($server[self::SERVER_Q_REDECLARE][$reason] > time() - self::QUEUE_REDECLARE_TTL) {
                return $server[self::SERVER_QUEUES][$reason];
            }
        }
        
        $this->_serverEnsureConnection($server, $reason);
        $channel = $this->_serverEnsureChannel($server, $reason);
        
        $queueName = 'reply:' . $this->nodeId;
        
        $queue = new \AMQPQueue($channel);
        $queue->setFlags(AMQP_AUTODELETE);
        $queue->setName($queueName);
        $queue->setArgument('x-expires', self::QUEUE_AUTO_DELETE_TTL * 1000); // очередь самоудалится через час
        $queue->declareQueue();
        if (self::DEFAULT_EXCHANGE) {
            $queue->bind(self::DEFAULT_EXCHANGE, $queueName);
        }
        
        $server[self::SERVER_QUEUES][$reason]      = $queue;
        $server[self::SERVER_Q_REDECLARE][$reason] = time();
        
        return $server[self::SERVER_QUEUES][$reason];
    }
644448
function process( $tpl, &$textElements, $functionName, $functionChildren, $functionParameters, $functionPlacement, $rootNamespace, $currentNamespace )
    {
        if ( count( $functionParameters ) == 0 || !count( $functionParameters['condition'] ) )
        {
            eZDebug::writeError( "Not enough arguments passed to 'if' function." );
            return;
        }

        $ifValue = $tpl->elementValue( $functionParameters['condition'], $rootNamespace, $currentNamespace, $functionPlacement );

        $show        = $ifValue; // whether to show the child being currently processing
        $showWasTrue = $show;    // true if $show has been assigned 'true' value at least once in the current {if}...{/if} block.
        $foundElse   = false;    // true if 'else' has been met once in the current {if}...{/if} block.

        if ( !is_array( $functionChildren ) )
        {
            return;
        }
        foreach ( $functionChildren as $key => $child )
        {
            $childType = $child[0];

            // parse 'elseif', 'else' functions
            if ( $childType == eZTemplate::NODE_FUNCTION )
            {
                $childFunctionName      =& $child[2];
                $childFunctionArgs      =& $child[3];
                $childFunctionPlacement =& $child[4];

                if ( $childFunctionName == 'else' )
                {
                    if ( $foundElse  )
                    {
                        eZDebug::writeError( "Duplicated 'else'" );
                        $show = false;
                        continue;
                    }

                    $show = !$showWasTrue;
                    $foundElse = true;
                    continue;
                }
                elseif ( $childFunctionName == 'elseif' )
                {
                    if ( $foundElse  )
                    {
                        eZDebug::writeError( "There should be no more 'elseif' after 'else'" );
                        $show = false;
                        continue;
                    }

                    if ( !isset( $childFunctionArgs['condition'] ) || !count( $childFunctionArgs['condition'] ) ) // no arguments passes to 'elseif' (should not happen)
                        $elseifValue = false;
                    else
                        $elseifValue = $tpl->elementValue( $childFunctionArgs['condition'], $rootNamespace, $currentNamespace, $functionPlacement );

                    if ( !$showWasTrue && $elseifValue )
                        $show = $showWasTrue = true;
                    else
                        $show = false;
                    continue;
                }
                elseif ( $childFunctionName == 'break' )
                {
                    if ( !$show )
                            continue;
                    return array( 'breakFunctionFound' => 1 );
                }
                elseif ( $childFunctionName == 'continue' )
                {
                    if ( !$show )
                            continue;
                    return array( 'continueFunctionFound' => 1 );
                }
                elseif ( $childFunctionName == 'skip' )
                {
                    if ( !$show )
                            continue;
                    return array( 'skipFunctionFound' => 1 );
                }
            }

            if ( $show )
            {
                $rslt = $tpl->processNode( $child, $textElements, $rootNamespace, $currentNamespace );

                // handle 'break', 'continue' and 'skip'
                if ( is_array( $rslt ) && ( array_key_exists( 'breakFunctionFound', $rslt ) ||
                                            array_key_exists( 'continueFunctionFound', $rslt )  ||
                                            array_key_exists( 'skipFunctionFound', $rslt ) ) )
                {
                    return $rslt;
                }
            }
        }
    }
468827
def function_body_action(self, text, loc, fun):
        """"""
        exshared.setpos(loc, text)
        if DEBUG > 0:
            print("FUN_BODY:",fun)
            if DEBUG == 2: self.symtab.display()
            if DEBUG > 2: return
        self.codegen.function_body()
1105737
function exec (ctx, scope, data) {
  console.log('exec', ctx, scope, data)
  var fn = getFunction(ctx, scope, data[0])
  var elements = data.slice(1)
  var params = elements.map(function (p) {
    return Array.isArray(p) ? exec(ctx, scope, p)
      : (p[0] === '$') ? ctx[p] : p
  }).filter(function (p) { return p !== VAR })
  return fn.apply(null, params)
}
1045924
private function _processFunctionStatement() {
		// Increment the number of functions
		$this->_ncssTotalFunctions ++;
		$this->_ncssFileFunctions ++;

		// Reset the default values
		$this->funcArgString = "";
		$this->_nbFunctionParameters = 0;
		$this->_functionParameters = array();
		$this->_inFunctionStatement = true;
		$this->_functionReturns = false;
		$this->_functionThrows = false;
		$this->_inControlStatement = false;
		$this->_currentStatement = false;
		$this->_inClassStatement = false;
		$this->_inInterfaceStatement = false;
		$this->_functionVisibility = 'PUBLIC';
		$this->_functionStatic = false;

		// Detect the visibility (on the token just before the current one).
		$previousToken = $this->tokenizer->peekPrvsValidToken();
		$this->_detectVisibility($previousToken);
		if ($previousToken->position > 1) {
			$prepreviousToken = $this->tokenizer->peekPrvsValidToken($previousToken->position - 1);
			$this->_detectVisibility($prepreviousToken);
		}

		// Find the function name
		$currentToken = $this->tokenizer->getCurrentToken();
		$curlyOpeningDetected = $this->tokenizer->checkNextToken(T_PARENTHESIS_OPEN);
		$nameDetected = null;
		while ($currentToken !== null && !$curlyOpeningDetected) {
			// Skip the token
			$this->tokenizer->getNextToken();
			$currentToken = $this->tokenizer->getCurrentToken();

			if ($currentToken->id === T_STRING) {
				$nameDetected = $currentToken->text;
			}
			$curlyOpeningDetected = $this->tokenizer->checkNextValidToken(T_PARENTHESIS_OPEN);
		}

		// currentToken should end up being the function name token

		// Tracking the function's name.
		if ($nameDetected !== null && trim($nameDetected) !== "") {
			$functionName = $currentToken->text;

			// Check the PHPDoc presence
			$this->_checkDocExists(T_FUNCTION);
		} else {
			// We have an anonymous function or closure.
			$functionName = 'anonymous';
			$this->_functionVisibility = 'ANONYMOUS';

			// We don't check the PHPDoc for anonymous functions
		}
		$this->_currentFunctionName = $functionName;

		// If the function is private we add it to the list of function to use (and store the line number)
		if ($this->_functionVisibility === 'PRIVATE') {
			$this->_privateFunctions[$functionName] = $functionName;
			$this->_privateFunctionsStartLines[$functionName] = $currentToken->line;
		}

		// Function is a constructor
		$constructorNamingStyle = $this->_config->getTestProperty('constructorNaming', 'naming');
		$useOldConstructorNamingStyle = ($constructorNamingStyle === 'old');
		$useNewConstructorNamingStyle = ($constructorNamingStyle === 'new');
		if (strtolower($functionName) === "__construct" && $this->_isActive('constructorNaming') && $useOldConstructorNamingStyle) {
			$msg = $this->_getMessage('CONSTRUCTOR_NAMING', $this->_currentClassname);

			$this->_writeError('constructorNaming', $msg);
		}

		// Special functions are not checked
		if (!in_array($functionName, $this->_specialFunctions)) {

			// Constructors
			if ($functionName === $this->_currentClassname) {

				// Function is a constructor
				if ($this->_isActive('constructorNaming') && $useNewConstructorNamingStyle) {
					$msg = $this->_getMessage('CONSTRUCTOR_NAMING', '__construct()');
					$this->_writeError('constructorNaming', $msg);
				}
			} else {

				// Other function
				if ($this->_functionVisibility === 'PRIVATE') {
					$this->_checkPrivateFunctionNaming($this->_currentFunctionName);
				} else if ($this->_functionVisibility === 'PROTECTED') {
					$this->_checkProtectedFunctionNaming($this->_currentFunctionName);
				} else {
					$this->_checkFunctionNaming($this->_currentFunctionName);
				}
			}
		}

		// List the arguments of the currently analyzed function.
		// Check the order of the parameters of the function.
		// The parameters having a default value should be in last position.
		$foundDefaultValues = false;
		$functionTokenPosition = $this->tokenizer->getCurrentPosition();

		$functionParamsStart = $this->tokenizer->findNextStringPosition('(', $functionTokenPosition);
		$functionParamsStop = $this->tokenizer->findClosingParenthesisPosition($functionTokenPosition);

		for ($i = $functionParamsStart; $i < $functionParamsStop; $i ++) {
			$functionToken = $this->tokenizer->peekTokenAt($i);

			// Current token is a parameter
			if ($this->tokenizer->checkToken($functionToken, T_VARIABLE)) {
				$this->_nbFunctionParameters ++;
				$parameterName = $functionToken->text;
				$this->_functionParameters[$parameterName] = "unused"; // We flag the parameter as unused

				// Check is this parameter as a default value
				$nextTokenInfo = $this->tokenizer->peekNextValidToken($i + 1);
				$hasDefaultValue = $this->tokenizer->checkToken($nextTokenInfo, T_EQUAL);
				if ($hasDefaultValue) {
					$foundDefaultValues = true;
				}

				// Check if the parameter has a default value
				if ($this->_isActive('defaultValuesOrder')) {
					if ($foundDefaultValues && !$hasDefaultValue) {
						$this->_writeError('defaultValuesOrder', $this->_getMessage('FUNC_DEFAULTVALUE_ORDER'));
						break;
					}
				}
			}
		}

		// Test for the max number of parameters
		if ($this->_isActive('functionMaxParameters')) {
			$paramCount = $this->_nbFunctionParameters;
			$maxParams = $this->_config->getTestProperty('functionMaxParameters', 'maxParameters');
			if ($paramCount > $maxParams) {
				$msg = $this->_getMessage('MAX_PARAMETERS', $this->_currentFunctionName, $paramCount, $maxParams);
				$this->_writeError('functionMaxParameters', $msg);
			}
		}
	}
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 );
                        }
                    }
                }
            }
        }
    }
149621
function internalAction(scope, page) {
                page = page.valueOf();
                // Block clicks we try to load the active page
                if (scope.page == page) {
                    return;
                }

                // Update the page in scope and fire any paging actions
                scope.page = page;
                scope.paginationAction({
                    page: page
                });

                // If allowed scroll up to the top of the page
                if (scope.scrollTop) {
                    scrollTo(0, 0);
                }
            }
74222
private final void internalInfo(Object source, Class sourceClass, String methodName, String messageIdentifier, Object object)
    {
        if (usePrintWriterForTrace)
        {
            if (printWriter != null)
            {
                StringBuffer stringBuffer = new StringBuffer(new java.util.Date().toString());

                stringBuffer.append(" I ");
                stringBuffer.append(sourceClass.getName());
                stringBuffer.append(".");
                stringBuffer.append(methodName);


                printWriter.println(stringBuffer.toString());
                printWriter.println("\t\t"+NLS.format(messageIdentifier, object));
                printWriter.flush();
            }
        }

        if (object != null)
        {
            Tr.info(traceComponent, messageIdentifier, object);
        }
        else
        {
            Tr.info(traceComponent, messageIdentifier);
        }
    }
537457
def _inner_func_anot(func):
    """"""
    @wraps(func)
    def new_func(*args):
        return func(*_lmap(_wrap_surface, args))
    return new_func
858421
function process( $tpl, &$textElements, $functionName, $functionChildren, $functionParameters, $functionPlacement, $rootNamespace, $currentNamespace )
    {
        $params = $functionParameters;
        switch ( $functionName )
        {
            case $this->BlockName:
            {
                $name ="";
                $menuIni = eZINI::instance( "menu.ini" );

                if ( isset( $functionParameters["name"] ) )
                {
                    $menuName = $tpl->elementValue( $functionParameters["name"], $rootNamespace, $currentNamespace, $functionPlacement );
                    if ( $menuIni->hasVariable( 'SelectedMenu', $menuName ) )
                    {
                        $menuTemplate = $menuIni->variable( 'SelectedMenu', $menuName );
                        if ( $menuTemplate != null )
                        {
                            $uri = "design:menu/$menuTemplate.tpl";
                            $tpl->processURI( $uri, true, $extraParameters, $textElements, $name, $name );
                        }
                    }
                }
            }
        }
    }
1018883
function functionWriter(&$doclet) {

        parent::MDWriter($doclet);

        $this->_id = "definition";

        $rootDoc = & $this->_doclet->rootDoc();

        $packages = & $rootDoc->packages();
        ksort($packages);

        foreach ($packages as $packageName => $package) {
            $this->_depth = $package->depth() + 1;

            ob_start();

            echo "- - -\n\n";

            echo "#Functions#\n\n";

            echo "- - -\n\n";

            $functions = & $package->functions();

            if ($functions) {
                ksort($functions);
                echo "<table id=\"summary_function\" class=\"title\">", "\n";
                echo "<tr><th colspan=\"2\" class=\"title\">Function Summary</th></tr>", "\n";
                foreach ($functions as $function) {
                    $textTag = & $function->tags("@text");
                    echo "<tr>\n";
                    echo "<td>", $this->_methodSignature($function), "</td>\n";
                    echo "<td class=\"description\">";
                    echo "<p class=\"name\"><a href=\"#", $this->_asURL($function),"\">", $function->name(), "</a>", $this->_flatSignature($function), "</p>";
                    if ($textTag) {
                        echo "<p class=\"description\">", strip_tags($this->_processInlineTags($textTag, TRUE), "<a><b>**<u><em>"), "</p>";
                    }
                    echo "</td>\n";
                    echo "</tr>\n";
                }
                echo "</table>\n\n";

                echo "<h2 id=\"detail_function\">Function Detail</h2>", "\n";
                foreach ($functions as $function) {
                    $textTag = & $function->tags("@text");
                    $this->_sourceLocation($function);
                    echo "<h3 id=\"", $function->name(), "()\">", $function->name(), "</h3>\n";
                    echo $this->_methodSignature($function);
                    echo " {$function->name()} {$this->_flatSignature($function)}\n\n";
                    echo "<div class=\"details\">\n";
                    if ($textTag) {
                        echo $this->_processInlineTags($textTag), "\n";
                    }
                    $this->_processTags($function->tags());
                    echo "</div>\n\n";
                    echo "- - -\n\n";
                }
            }

            $this->_output = ob_get_contents();
            ob_end_clean();

            $this->_write($this->_normalize($package->_name) . "_package-functions.md");
        }
    }
147880
function (beyond) {
        "use strict";
    
        var items = {};
        var keys = [];
        Object.defineProperty(this, 'items', {
            'get': function () {
                return items;
            }
        });
        Object.defineProperty(this, 'keys', {
            'get': function () {
                return keys;
            }
        });
        Object.defineProperty(this, 'length', {
            'get': function () {
                return keys.length;
            }
        });
    
        this.get = function (name) {
    
            if (items[name]) return items[name];
    
            var library = new Library(beyond, name);
            items[name] = library;
            keys.push(name);
    
            return library;
    
        };
    
    }
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); }}
1141777
function functions() {
		extend(Function.prototype, {
			bind: function bind(oThis) {
				if (typeof this !== "function") {
					throw new TypeError("Function bind not callable");
				}
				var fSlice = Array.prototype.slice,
					aArgs = fSlice.call(arguments, 1),
					fToBind = this,
					Fnop = function() {},
					fBound = function() {
						return fToBind.apply(
							this instanceof Fnop ? this : oThis || window,
							aArgs.concat(fSlice.call(arguments))
						);
					};
				Fnop.prototype = this.prototype;
				fBound.prototype = new Fnop();
				return fBound;
			}
		});
	}
183141
function functs(...f) {
    /**
     * execute all included functions
     * @param {...*} [args] - arguments passed to all included functions
     * @returns {*[]}
     */
    function functs(...args) {
        return functs.run(this, args);
    }

    if(Array.isArray(f[0])) {
        f = f[0];
    }
    
    functs._f = f.filter((f) => {
        return typeof f === 'function';
    });
    functs.add = add.bind(functs);
    functs.remove = remove.bind(functs);
    functs.run = run.bind(functs);
    return functs;
}
8479
private void internalAdd(Cell cell)
    {
        if (cells.length == size)
            cells = Arrays.copyOf(cells, Math.max(MINIMAL_CAPACITY, size * 3 / 2 + 1));
        cells[size++] = cell;
    }
235616
private void internalSet(VarTensor newFactor) {
        this.vars = newFactor.vars;
        this.dims = newFactor.dims;
        this.strides = newFactor.strides;
        this.values = newFactor.values;
    }