Initialize the PackageDescriptor from the Package
490765
private static void initFromPackage(PackageDescriptor pd,
                                        Package pkg) {

        pd.setExists(true);

        String specificationTitle = pkg.getSpecificationTitle();
        String specificationVersion = pkg.getSpecificationVersion(); 
        String specificationVendor = pkg.getSpecificationVendor();

        String implementationTitle = pkg.getImplementationTitle();
        String implementationVersion = pkg.getImplementationVersion(); 
        String implementationVendor = pkg.getImplementationVendor();

        if (implementationTitle == null) {
            implementationTitle = specificationTitle;
        }

        if (implementationVersion == null) {
            implementationVersion = specificationVersion;
        }

        if (implementationVendor == null) {
            implementationVendor = specificationVendor;
        }


        pd.setSpecificationTitle(specificationTitle);
        pd.setSpecificationVersion(specificationVersion);
        pd.setSpecificationVendor(specificationVendor);

        pd.setImplementationTitle(implementationTitle);
        pd.setImplementationVersion(implementationVersion);
        pd.setImplementationVendor(implementationVendor);

        pd.setProduct(implementationTitle);
        pd.setProductVersion(implementationVersion);
    }
335120
def initialize_plugin(self):
        
        # Generate a list of blacklisted packages from the configuration and
        # store it into self.blacklist_package_names attribute so this
        # operation doesn't end up in the fastpath.
        if not self.blacklist_package_names:
            self.blacklist_package_names = self._determine_filtered_package_names()
            logger.info(
                f"Initialized project plugin {self.name}, filtering "
                + f"{self.blacklist_package_names}"
            )
924883
function init (options) {
  if (typeof options === 'string') {
    options = { base: options }
  }

  options = options || {}

  // There is probably 99% chance that the project root directory in located
  // above the node_modules directory
  var base = nodePath.resolve(
    options.base || nodePath.join(__dirname, '../..')
  )
  var packagePath = base.replace(/\/package\.json$/, '') + '/package.json'

  try {
    var npmPackage = require(packagePath)
  } catch (e) {
    // Do nothing
  }

  if (typeof npmPackage !== 'object') {
    throw new Error('Unable to read ' + packagePath)
  }

  //
  // Import aliases
  //

  var aliases = npmPackage._moduleAliases || {}

  for (var alias in aliases) {
    if (aliases[alias][0] !== '/') {
      aliases[alias] = nodePath.join(base, aliases[alias])
    }
  }

  addAliases(aliases)

  //
  // Register custom module directories (like node_modules)
  //

  if (npmPackage._moduleDirectories instanceof Array) {
    npmPackage._moduleDirectories.forEach(function (dir) {
      if (dir === 'node_modules') return

      var modulePath = nodePath.join(base, dir)
      addPath(modulePath)
    })
  }
}
486188
public void init(Object workingMemoryContext,
                     Object context,
                     Tuple tuple,
                     Declaration[] declarations,
                     WorkingMemory workingMemory) throws Exception {
        Object[] localVars = new Object[initUnit.getOtherIdentifiers().length];
        
        MVELAccumulatorFactoryContext factoryContext = (MVELAccumulatorFactoryContext)workingMemoryContext;
        VariableResolverFactory factory = factoryContext.getInitFactory();
        initUnit.updateFactory( null, tuple, localVars, (InternalWorkingMemory) workingMemory, workingMemory.getGlobalResolver(), factory );

        InternalKnowledgePackage pkg = workingMemory.getKnowledgeBase().getPackage( "MAIN" );
        if ( pkg != null ) {
            MVELDialectRuntimeData data = (MVELDialectRuntimeData) pkg.getDialectRuntimeRegistry().getDialectData( "mvel" );
            factory.setNextFactory( data.getFunctionFactory() );
        }

        MVELSafeHelper.getEvaluator().executeExpression( this.init,
                                null,
                                factory );
        
        
        DroolsVarFactory df = ( DroolsVarFactory ) factory.getNextFactory();
        if ( localVars.length > 0 ) {
            for ( int i = 0; i < df.getOtherVarsLength(); i++ ) {
                localVars[i] = factory.getIndexedVariableResolver( df.getOtherVarsPos() + i ).getValue();
            }
        }
        
        ((MVELAccumulatorContext) context).setVariables( localVars );
    }
1349996
protected void packageDef(AST packageDef) {
        List<AnnotationNode> annotations = new ArrayList<AnnotationNode>();
        AST node = packageDef.getFirstChild();
        if (isType(ANNOTATIONS, node)) {
            processAnnotations(annotations, node);
            node = node.getNextSibling();
        }
        String name = qualifiedName(node);
        // TODO should we check package node doesn't already exist? conflict?
        PackageNode packageNode = setPackage(name, annotations);
        configureAST(packageNode, packageDef);
    }
1035833
public void init(Configuration configuration)
			throws Exception
	{
		LOGGER.debug("Initializing AbstractBundleInterceptor");

		localizationBundleFactory = configuration.getLocalizationBundleFactory();

		findResourceBundleFactory(configuration);
	}
196236
public void setPackager( final CharSequence packager) {
		if ( packager != null) format.getHeader().createEntry( PACKAGER, packager);
	}
901525
@PostConstruct
    void init() {
        if (CollectionUtils.isNotEmpty(reactiveInstrumenters)) {
            oldCompletableHook =
                    RxJavaPlugins.getOnCompletableAssembly();
            oldMaybeHook = RxJavaPlugins.getOnMaybeAssembly();
            oldSingleHook = RxJavaPlugins.getOnSingleAssembly();
            oldObservableHook =
                    RxJavaPlugins.getOnObservableAssembly();
            oldFlowableHook =
                    RxJavaPlugins.getOnFlowableAssembly();
            oldConnectableFlowableHook =
                    RxJavaPlugins.getOnConnectableFlowableAssembly();
            oldConnectableObservableHook =
                    RxJavaPlugins.getOnConnectableObservableAssembly();
            oldParallelFlowableHook =
                    RxJavaPlugins.getOnParallelAssembly();

            RxJavaPlugins.setOnCompletableAssembly(completable -> {
                final Completable wrapped = RxInstrumentedWrappers.wrap(completable, reactiveInstrumenters);
                if (oldCompletableHook != null) {
                    return oldCompletableHook.apply(wrapped);
                }
                return wrapped;
            });

            RxJavaPlugins.setOnMaybeAssembly(maybe -> {
                final Maybe wrapped = RxInstrumentedWrappers.wrap(maybe, reactiveInstrumenters);
                if (oldMaybeHook != null) {
                    return oldMaybeHook.apply(wrapped);
                }
                return wrapped;
            });

            RxJavaPlugins.setOnSingleAssembly(single -> {
                final Single wrapped = RxInstrumentedWrappers.wrap(single, reactiveInstrumenters);
                if (oldSingleHook != null) {
                    return oldSingleHook.apply(wrapped);
                }
                return wrapped;
            });

            RxJavaPlugins.setOnObservableAssembly(observable -> {
                final Observable wrapped = RxInstrumentedWrappers.wrap(observable, reactiveInstrumenters);
                if (oldObservableHook != null) {
                    return oldObservableHook.apply(wrapped);
                }
                return wrapped;
            });

            RxJavaPlugins.setOnFlowableAssembly(flowable -> {
                final Flowable wrapped = RxInstrumentedWrappers.wrap(flowable, reactiveInstrumenters);
                if (oldFlowableHook != null) {
                    return oldFlowableHook.apply(wrapped);
                }
                return wrapped;
            });

            RxJavaPlugins.setOnConnectableFlowableAssembly(
                    connectableFlowable -> {
                        final ConnectableFlowable wrapped = RxInstrumentedWrappers.wrap(connectableFlowable, reactiveInstrumenters);
                        if (oldConnectableFlowableHook != null) {
                            return oldConnectableFlowableHook.apply(wrapped);
                        }
                        return wrapped;
                    });

            RxJavaPlugins.setOnConnectableObservableAssembly(connectableObservable -> {
                final ConnectableObservable wrapped = RxInstrumentedWrappers.wrap(connectableObservable, reactiveInstrumenters);
                if (oldConnectableObservableHook != null) {
                    return oldConnectableObservableHook.apply(connectableObservable);
                }
                return wrapped;
            });

            RxJavaPlugins.setOnParallelAssembly(parallelFlowable -> {
                final ParallelFlowable wrapped = RxInstrumentedWrappers.wrap(parallelFlowable, reactiveInstrumenters);
                if (oldParallelFlowableHook != null) {
                    return oldParallelFlowableHook.apply(wrapped);
                }
                return wrapped;
            });

        }

        if (CollectionUtils.isNotEmpty(instrumenters)) {
            Function<? super Runnable, ? extends Runnable> existing = RxJavaPlugins.getScheduleHandler();
            if (existing != null && !(existing instanceof RxJava2Instrumentation)) {
                RxJavaPlugins.setScheduleHandler(runnable -> this.apply(existing.apply(runnable)));
            } else {
                RxJavaPlugins.setScheduleHandler(this);
            }
        }
    }
444195
public void initialize() {
		// Initialize the SRE list
		this.runtimeEnvironments.clear();
		final ISREInstall[] sres = SARLRuntime.getSREInstalls();
		Arrays.sort(sres, new Comparator<ISREInstall>() {
			@Override
			public int compare(ISREInstall o1, ISREInstall o2) {
				return o1.getName().compareTo(o2.getName());
			}
		});
		final List<String> labels = new ArrayList<>(sres.length);
		for (int i = 0; i < sres.length; ++i) {
			if (sres[i].getValidity().isOK()) {
				this.runtimeEnvironments.add(sres[i]);
				labels.add(sres[i].getName());
			}
		}
		this.runtimeEnvironmentCombo.setItems(labels.toArray(new String[labels.size()]));

		// Reset the labels of the external SRE configurations
		updateExternalSREButtonLabels();

		// Initialize the type of configuration
		if (this.enableSystemWideSelector) {
			this.specificSREButton.setSelection(false);
			if (!this.projectProviderFactories.isEmpty()) {
				this.projectSREButton.setSelection(false);
			}
			this.systemSREButton.setSelection(true);
		} else if (!this.projectProviderFactories.isEmpty()) {
			this.specificSREButton.setSelection(false);
			if (this.enableSystemWideSelector) {
				this.systemSREButton.setSelection(false);
			}
			this.projectSREButton.setSelection(true);
		}

		// Wait for SRE list updates.
		this.sreListener = new InstallChange();
		SARLRuntime.addSREInstallChangedListener(this.sreListener);

		updateEnableState();
	}
532950
public function init()
    {
        $this->addCommand(ImportCommand::class);
        $this->addCommand(ClearCommand::class);

        $this->addGlobalOption('c')
            ->alias('class')
            ->defaultValue('MainSeeder')
            ->description('The class to import.');

        $this->addGlobalOption('d')
            ->alias('dir')
            ->description('The directory of this seeder.');

        $this->addGlobalOption('p')
            ->alias('package')
            ->description('Package name to import seeder.');

        parent::init();
    }
1252970
def write_init_files(packages):
    
    init_text = """__path__ = __import__('pkgutil').extend_path(__path__, __name__)

try:
    from .__doc__ import __doc__
except ImportError:
    pass
"""
    for package in packages:
        path = os.path.join('src', package.replace('.', os.sep), '__init__.py')
        if os.path.exists(path):
            with open(path) as f:
                old_text = f.read()
        else:
            old_text = ''
        if old_text != init_text:
            with open(path, 'w') as f:
                f.write(init_text)
640669
private void initialize() {
		this.setCursor(new java.awt.Cursor(java.awt.Cursor.WAIT_CURSOR));
		this.setResizable(false);
		this.setContentPane(getAboutPanel());
		this.pack();
		centerFrame();
	}
152035
@Override
	public void init() {
		RepositoryConfigurationExtension extension = new SimpleDbRepositoryConfigExtension();
		RepositoryBeanDefinitionParser repositoryBeanDefinitionParser = new RepositoryBeanDefinitionParser(extension);

		registerBeanDefinitionParser("repositories", repositoryBeanDefinitionParser);
	}
338638
def init(self):
        
        # import any compiled resource modules
        if not self._initialized:
            self._initialized = True
            wrap = projexui.qt.QT_WRAPPER.lower()
            ignore = lambda x: not x.split('.')[-1].startswith(wrap)
            projex.importmodules(self.plugins(), ignore=ignore)
605910
protected function initializePackageData()
    {
        $filePath = $this->vendorDir . DIRECTORY_SEPARATOR . self::PACKAGE_DATA_FILENAME;
        if (!is_file($filePath)) {
            $this->packagesData = array();
        } else {
            $this->packagesData = json_decode(file_get_contents($filePath), true);
        }
    }
474953
public void init(ConvertCode parent, Packages recPackages)
    {
        m_recPackages = null;
        m_recPackages = recPackages;
        super.init(parent, null);
    }
594199
def descriptors(package):
    
    from os import path
    dpath = _descriptor_path(package)
    if path.isfile(dpath):
        import json
        with open(dpath) as f:
            jdb = json.load(f)
        return jdb
    else:
        return None