/*!
\private

Makes sure extra includes are loaded (include_once) so extra functions can be used.
\note This function will only run one time, if called multiple times it will simple return
432187
function initializeIncludes()
    {
        // If we have this global variable we shouldn't do any processing
        if ( !empty( $GLOBALS['eZSimpleTagsInit'] ) )
            return;

        $GLOBALS['eZSimpleTagsInit'] = true;
        $ini = eZINI::instance( 'template.ini' );
        $extensions = $ini->variable( 'SimpleTagsOperator', 'Extensions' );
        $pathList = eZExtension::expandedPathList( $extensions, 'simpletags' );
        $includeList = $ini->variable( 'SimpleTagsOperator', 'IncludeList' );

        foreach ( $includeList as $includeFile )
        {
            foreach ( $pathList as $path )
            {
                $file = $path . '/' . $includeFile;
                if ( file_exists( $file ) )
                {
                    include_once( $file );
                }
            }
        }
    }
310647
def handle_includes(defns):
    '''
    '''
    newdefns = []
    for d in defns:
        if isinstance(d,list):
            newdefns.extend(handle_includes(d))
        else:
            newdefns.append(d)

    return newdefns
1102212
function includeReferences(include, doc) {
  _.each(include, function (keypath) {
    var parts = keypath.split('.')
    var key = parts.shift()

    if (_.has(doc, key) && _.isString(doc[key])) {
      var ref = doc[key].split(':')
      doc[key] = getDocument({ collection: ref[0], id: ref[1] })

      if (parts.length > 0) {
        includeReferences(parts.slice(1), doc[key])
      }
    }
  })
}
1325312
function extras(src, js, options) {
		if (options.superword) {
			js = suber.pseudokeyword(
				js,
				getwords(options.superword, defaultoptions.superword),
				getwords(options.classword, defaultoptions.classword)
			);
		}
		return js;
	}
605295
public function init()
    {
        parent::init();

        /**
         * check whether we have extraRowColumns set, forbid filters
         */
        if (!empty($this->extraRowColumns)) {
            foreach ($this->columns as $column) {
                if ($column instanceof CDataColumn && in_array($column->name, $this->extraRowColumns)) {
                    $column->filterHtmlOptions = array('style' => 'display:none');
                    $column->filter = false;
                }
            }
        }
        /**
         * setup extra row options
         */
        if (isset($this->extraRowHtmlOptions['class']) && !empty($this->extraRowCssClass)) {
            $this->extraRowHtmlOptions['class'] .= ' ' . $this->extraRowCssClass;
        } else {
            $this->extraRowHtmlOptions['class'] = $this->extraRowCssClass;
        }
    }
110627
function onceify(f) {
  var ran, ret;
  return function() {
    return ran ? ret : (ran=true, ret=f.apply(this,arguments));
  };
}
1007422
def p_include_once(p):
    
    if ENABLED:
        p[0] = include_once(p[3], p.lineno(3), local_first=True)
    else:
        p[0] = []

    if not p[0]:
        p.lexer.next_token = '_ENDFILE_'
326602
function include(partial, cb) {
    cb((params.partials && params.partials[partial]) ?
      params.partials[partial] :
      '[error] partial ' + partial + ' does not exist');
  }
1194295
function ensure(parent, ids, fn) {
		ids = [].concat(ids);
		var visited = {}, wait = 0;

		function done() {
			if (fn) { fn.apply(global, map(ids, function(id) { return require(parent, id); })); }
			fn = undefined;
		}
		function visit(module) {
			if (module.id in visited) { return; }
			if ((visited[module.id] = module.loaded)) { return map(module.children, visit); }

			++wait;
			waits[module.id].push(function() {
				map(module.children, visit);
				if (--wait <= 0) { setTimeout(done, 0); }
			});

			var script;
			map(doc.querySelectorAll('script'), function(node) {
				if (canonicalize(node.src) === module.uri) { script = node; }
			});

			if (!script) {
				script = doc.createElement('script');
				script.onload = script.onerror = script.onreadystatechange = function() {
					if ('loading' === script.readyState) { return; }
					script.onload = script.onerror = script.onreadystatechange = null;
					fireWaits(module);
				};
				script.defer = true;
				script.src = module.uri;
				doc.querySelector('head').appendChild(script);
			}
		}

		map(ids, function(id) { visit(getModule(parent, id)); });
		if (wait <= 0) { setTimeout(done, 0); } // always async
	}
713840
def run_once(function, state={}, errors={}):
    """"""
    @six.wraps(function)
    def _wrapper(*args, **kwargs):
        if function in errors:
            # Deliberate use of LBYL.
            six.reraise(*errors[function])

        try:
            return state[function]
        except KeyError:
            try:
                state[function] = result = function(*args, **kwargs)
                return result
            except Exception:
                errors[function] = sys.exc_info()
                raise
    return _wrapper
1231704
function includeProperty (key, value, replacer) {
  return typeof value !== 'undefined'
      && typeof value !== 'function'
      && (!Array.isArray(replacer) || contains(replacer, key));
}
61913
function includeServedOnly(files) {
	files = Object.assign({}, files);
	let oldIncluded = files.included;
	files.included = files.served
		// Don’t include the files that are included in the outer context
		.filter(file => oldIncluded.indexOf(file) === -1)
		// Don’t include this (or other) contexts
		.filter(file => !isIFrameHtml(file.path))
		// Don’t include files that were never included to begin with (before the framework ran)
		// FIXME: find the most specific applicable pattern first
		.filter(file => !nonIncludedFiles.some(pattern => minimatch(file.originalPath, pattern.pattern)))
		// Don’t include the reverse context (it is included by the `transform` function below)
		.filter(file => file.originalPath !== REVERSE_CONTEXT);
	return files;
}
73782
function (events, func) {
    for (var i = 0; i < events.length; i++) {
      obj.once(events[i], func)
      listeners[events[i]] = func
    }
  }
618271
protected function includes()
    {
        $moduleInclude = (array) $this->def('include');
        $globalInclude = $this->app['config']->get('module::include');
        $specificInclude = array($this->name.'.php');
        $include = array_merge($moduleInclude, $specificInclude, $globalInclude);
        foreach ($include as $file)
		{
			$path = $this->path.'/'.$file;
			if ($this->app['files']->exists($path)) require $path;
		}
    }
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;
}
596586
function once(f) {
    function g() {
      f.apply(this, arguments)
      remove(g) }
    add(g)
    return notify }
21382
def call_only_once(func):
    
    @functools.wraps(func)
    def wrapper(*args, **kwargs):
        self = args[0]
        # cannot use hasattr here, because hasattr tries to getattr, which
        # fails if func is a property
        assert func.__name__ in dir(self), "call_only_once can only be used on method or property!"

        if not hasattr(self, '_CALL_ONLY_ONCE_CACHE'):
            cache = self._CALL_ONLY_ONCE_CACHE = set()
        else:
            cache = self._CALL_ONLY_ONCE_CACHE

        cls = type(self)
        # cannot use ismethod(), because decorated method becomes a function
        is_method = inspect.isfunction(getattr(cls, func.__name__))
        assert func not in cache, \
            "{} {}.{} can only be called once per object!".format(
                'Method' if is_method else 'Property',
                cls.__name__, func.__name__)
        cache.add(func)

        return func(*args, **kwargs)

    return wrapper