------------------------------------------------------------------ Setup and statics ------------------------------------------------------------------
961917
function Tourney(np, inst) {
  this._inst = inst;
  this.matches = inst.matches; // proxy reference
  this.oldMatches = []; // stash matches from completed instances here
  this._stage = 1;
  this._oldRes = [];
  this.state = [];
  // for determining when we can expect Tourney API
  Object.defineProperty(this, 'hasStages', { value: true });
}
463578
@PostConstruct
    public void init() {
        if (defaultDistributionSetTypeLayout.getComponentCount() > 0) {
            configurationViews.add(defaultDistributionSetTypeLayout);
        }
        configurationViews.add(repositoryConfigurationView);
        configurationViews.add(rolloutConfigurationView);
        configurationViews.add(authenticationConfigurationView);
        configurationViews.add(pollingConfigurationView);
        if (customConfigurationViews != null) {
            configurationViews.addAll(
                    customConfigurationViews.stream().filter(ConfigurationGroup::show).collect(Collectors.toList()));
        }

        final Panel rootPanel = new Panel();
        rootPanel.setStyleName("tenantconfig-root");

        final VerticalLayout rootLayout = new VerticalLayout();
        rootLayout.setSizeFull();
        rootLayout.setMargin(true);
        rootLayout.setSpacing(true);

        configurationViews.forEach(rootLayout::addComponent);

        final HorizontalLayout buttonContent = saveConfigurationButtonsLayout();
        rootLayout.addComponent(buttonContent);
        rootLayout.setComponentAlignment(buttonContent, Alignment.BOTTOM_LEFT);
        rootPanel.setContent(rootLayout);
        setCompositionRoot(rootPanel);

        configurationViews.forEach(view -> view.addChangeListener(this));
    }
379517
public function setUp()
    {
        if ($this->filesystem->exists($this->outputDir) === false) {
            return;
        }

        $finder = new Finder();
        $finder->in($this->outputDir)
            ->depth('== 0');

        $this->filesystem->remove($finder);
    }
232383
public function init()
    {
        // Place parameters in static storage for common use
        #$this->R = 6370997.0; //Radius of earth

        if (isset($this->sphere)) {
            //fixes SR-ORG:6965
            $this->en = Common::pj_enfn( $this->es );
        } else {
            $this->n = 1.;
            $this->m = 0.;
            $this->es = 0;
            $this->C_y = sqrt( ($this->m + 1.) / $this->n );
            $this->C_x = $this->C_y / ($this->m + 1.);
        }
    }
322232
protected function setUp(): void
    {
        parent::setUp();

        $this->prevSniffedFile = $this->file->getFilename();

        if (!array_key_exists($var = $this->token['content'], $this->sniffedVars)) {
            // "Sniff" the var name only once ...
            $this->sniffedVars[$var] = Common::isCamelCaps(substr($var, 1));
        }
    }
1018834
protected function setup_components() {
		$this->load_components();

		$components = $this->get_components();
		$this->set_component_parents( $components );
		/** @var \ComposePress\Core\Abstracts\Component[] $components */
		foreach ( $components as $component ) {
			if ( method_exists( $component, 'init' ) ) {
				$component->init();
			}
		}
	}
480549
protected function setUp(): void
    {
        parent::setUp();

        $this->invalidStructure = [
            T_ARRAY => [T_OPEN_PARENTHESIS, T_CLOSE_PARENTHESIS],
            T_OPEN_SHORT_ARRAY => [T_CLOSE_SHORT_ARRAY]
        ];
    }
1286513
public function init()
    {
        self::$_aCollectedComponentNames = null;

        if (!empty($this->_aComponentNames)) {
            foreach ($this->_aComponentNames as $sComponentName => $sCompCache) {
                $oActTopView = \OxidEsales\Eshop\Core\Registry::getConfig()->getTopActiveView();
                if ($oActTopView) {
                    $this->_oaComponents[$sComponentName] = $oActTopView->getComponent($sComponentName);
                    if (!isset($this->_oaComponents[$sComponentName])) {
                        $this->_blLoadComponents = true;
                        break;
                    } else {
                        $this->_oaComponents[$sComponentName]->setParent($this);
                    }
                }
            }
        }

        parent::init();
    }
790720
function buildViewStatics( def, code ) {
    try {
        let statics = def[ "view.statics" ];

        if ( typeof statics === 'undefined' ) return;
        if ( typeof statics === 'string' ) statics = [ statics ];
        else if ( !Array.isArray( statics ) ) {
            throw Error( "view.statics must be a string or an array of strings!" );
        }

        statics.forEach( function ( name ) {
            code.addNeededBehindFunction( name );
            code.section.statics.push(
                "ViewClass" + keySyntax( name ) + " = CODE_BEHIND" + keySyntax( name ) + ".bind(ViewClass);"
            );
        } );
    } catch ( ex ) {
        throw ex + "\n...in view.statics: " + JSON.stringify( statics );
    }
}
680386
protected function setupLayout()
    {
        $this->layoutManager->setupLayout($this->layout);
        $this->setupStateProvider();
        $this->initStaticPart();


    }
1280586
private static function init()
    {
        if (!static::$initialized) {
            $baseClass = Base::getInstance();
            static::$initialized = true;
            static::$tagsData = $baseClass->Html->Tags;
        }
    }
470344
public function init()
    {
        $grav = Grav::instance();
        /** @var Config $config */
        $config = $grav['config'];

        $asset_config = (array)$config->get('system.assets');

        /** @var UniformResourceLocator $locator */
        $locator = $grav['locator'];
        $this->assets_dir = $locator->findResource('asset://') . DS;
        $this->assets_url = $locator->findResource('asset://', false);

        $this->config($asset_config);

        // Register any preconfigured collections
        foreach ((array) $this->collections as $name => $collection) {
            $this->registerCollection($name, (array)$collection);
        }
    }
765615
@Before
    public void setUp() {
        defineApplicationLocales();

        clearKeys();

        List<Key> keys = new ArrayList<>();
        keys.add(createKey(KEY_DEFAULT, false, false, false));

        Key outdatedKey = createKey(KEY_OUTDATED, false, false, false);
        outdatedKey.setOutdated();
        keys.add(outdatedKey);

        keys.add(createKey(KEY_TLN_APPROX, true, false, false));
        keys.add(createKey(KEY_TLN_OUTDATED, false, true, false));
        keys.add(createKey(KEY_TLN_MISSING, false, false, true));

        Key key = keyFactory.createKey(KEY_WITH_MISSING_TRANSLATION);
        key.addTranslation(FR, TRANSLATION_FR);
        keys.add(key);

        for (Key keyToPersist : keys) {
            keyRepository.add(keyToPersist);
        }
    }
278640
private function setup()
    {
        $this->runner = $this->specHelper->getRunner();

        $this->setupWorkspace();
        $this->setupTargets();

        // call initializers
        foreach ($this->application->config('spec.initializers.*') as $initializer) {
            $initializer($this->application);
        }
    }
336149
@Setup
    public void setup() {
        baseClassDescription = TypePool.Default.ofSystemLoader().describe(baseClass.getName()).resolve();
    }
112331
def init(scope, app, settings):
    """"""
    cfg = settings.get('rw.static', {})
    static = Static()
    scope['static'] = static
    scope['template_env'].globals['static'] = static
    for base_uri, sources in cfg.items():
        full_paths = []
        for source in sources:
            if isinstance(source, dict):
                full_path = source['path']
                full_paths.append(full_path.format(**os.environ))
                continue
            elif ',' in source:
                module_name, path = [part.strip()
                                     for part in source.split(',')]
            else:
                module_name = source
                path = 'static'
            full_path = pkg_resources.resource_filename(module_name, path)
            full_paths.append(full_path)

        app.root.mount('/' + base_uri + '/<h>/<path:path>',
                       StaticHandler, {'path': full_paths},
                       name='static_' + base_uri.replace('.', '_'))

        static.handlers.append((base_uri, StaticHandler, full_paths))
    static.setup()
150028
function initDir (config) {
    // create global dir config
    config.dir = {
        assets: [__dirname+'/assets'],
        app: [],
        components: [],
        helpers: [__dirname+'/helpers'],
        layouts: [__dirname+'/layouts'],
        partials: [__dirname+'/partials'],
        services: [],
        views: [__dirname+'/views'],
    }
    // iterate over modules getting and merging directories for each
    _.each(config.moduleNames, moduleName => {
        // get module
        var module = config.modules[moduleName]
        // iterate over dir configs
        _.each(config.dir, (dirs, dirName) => {
            // get directories for module
            var moduleDirs = getDir(module, dirName)
            // debug
            debug('initDir %s %s', moduleName, dirName, moduleDirs)
            // add module dirs to config
            _.each(moduleDirs, moduleDir => config.dir[dirName].push(moduleDir))
        })
    })
    // debug merged dirs
    debug('initDir', config.dir)
}