Initialize the plugin framework
196757
def init(plugindirs=[]):
    """"""

    # initialize the builtin plugins
    from .translators import yang,yin,dsdl
    yang.pyang_plugin_init()
    yin.pyang_plugin_init()
    dsdl.pyang_plugin_init()

    # initialize installed plugins
    for ep in pkg_resources.iter_entry_points(group='pyang.plugin'):
        plugin_init = ep.load()
        plugin_init()

    # search for plugins in std directories (plugins directory first)
    basedir = os.path.split(sys.modules['pyang'].__file__)[0]
    plugindirs.insert(0, basedir + "/transforms")
    plugindirs.insert(0, basedir + "/plugins")

    # add paths from env
    pluginpath = os.getenv('PYANG_PLUGINPATH')
    if pluginpath is not None:
        plugindirs.extend(pluginpath.split(os.pathsep))

    syspath = sys.path
    for plugindir in plugindirs:
        sys.path = [plugindir] + syspath
        try:
            fnames = os.listdir(plugindir)
        except OSError:
            continue
        modnames = []
        for fname in fnames:
            if (fname.startswith(".#") or
                fname.startswith("__init__.py") or
                fname.endswith("_flymake.py") or
                fname.endswith("_flymake.pyc")):
                pass
            elif fname.endswith(".py"):
                modname = fname[:-3]
                if modname not in modnames:
                    modnames.append(modname)
            elif fname.endswith(".pyc"):
                modname = fname[:-4]
                if modname not in modnames:
                    modnames.append(modname)
        for modname in modnames:
            pluginmod = __import__(modname)
            try:
                pluginmod.pyang_plugin_init()
            except AttributeError as s:
                print(pluginmod.__dict__)
                raise AttributeError(pluginmod.__file__ + ': ' + str(s))
        sys.path = syspath
1363618
private void init() {
        setTitle("Validation Framework Test");
        setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);

        // Add contents
        JPanel contentPane = new JPanel(new MigLayout("fill, wrap 1", "[]", "[grow]unrelated[]"));
        setContentPane(contentPane);

        contentPane.add(new JScrollPane(table), "grow");
        installValidators(table);
        contentPane.add(changeButton, "align right");

        // Set size
        pack();
        Dimension size = getSize();
        size.width += 100;
        setMinimumSize(size);

        // Set location
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        setLocation((screenSize.width - size.width) / 2, (screenSize.height - size.height) / 3);
    }
78416
public function _initialize()
    {
        parent::_initialize();

        $this->configBackCompat();

        $adminPath = $this->config['adminPath'];
        $this->loginUrl = str_replace('wp-admin', 'wp-login.php', $adminPath);
        $this->adminPath = rtrim($adminPath, '/');
        $this->pluginsPath = $this->adminPath . '/plugins.php';
    }
785514
public function initialize()
    {
         parent::initialize();
        $this->loadComponent('RequestHandler');
        
        $this->loadComponent('Rita/Tools.Flash');
        
        $this->loadComponent('Cookie');
        
        if( Plugin::loaded('Rita/Users')) {
            $this->loadComponent('Rita/Users.User');    
        }
        
        
        
        
         //$this->layout = $this->request->param('prefix');
        

        if (in_array($this->request->param('prefix'), ['admin', 'client'])) {
            $this->theme = 'Rita/Core';
        }

    }
954011
public static function init()
    {
        self::$loader = new Twig_Loader_Filesystem();

        $config = Config::getInstance();

        foreach (array_reverse($config->get('Octo.paths.templates', [])) as $path) {
            self::$loader->addPath($path);
        }

        foreach (array_reverse($config->get('Octo.paths.admin_templates', [])) as $path) {
            self::$loader->addPath($path, 'admin');
        }

        self::$loader->addPath(CMS_PATH . 'Database/Templates/', 'db');

        if (OCTO_CACHE_ENABLED) {
            self::$cache = OCTO_CACHE_PATH;
        } else {
            self::$cache = false;
        }

        self::$twig = new Twig_Environment(self::$loader, [
            'charset' => 'UTF-8',
            'cache' => self::$cache,
            'auto_reload' => true,
            'strict_variables' => false,
        ]);

        $functions = [];
        Event::trigger('TemplateInit', $functions);

        foreach ($functions as $name => $callable) {
            self::addFunction($name, $callable);
        }

        self::$initialised = true;
    }
1317429
public void initAllLoadedPlugins() throws PluginException {
		LOGGER.debug("Initializig all loaded plugins");
		for (Class<? extends Plugin> pluginClass : implementations.keySet()) {
			Set<PluginContext> set = implementations.get(pluginClass);
			for (PluginContext pluginContext : set) {
				try {
					pluginContext.initialize(pluginContext.getSystemSettings());
				} catch (Throwable e) {
					LOGGER.error("", e);
					pluginContext.setEnabled(false, false);
				}
			}
		}
	}
877803
function init() {
        $this->blockname = get_class($this);
        $this->title = get_string('pluginname', $this->blockname);
    }
853371
private function initializePlugin($pluginId) {

		$configData = $this->config->plugins[$pluginId];

		// load class file

		$class	= str_replace('/', '\\', $configData['class']);
		
		$file	= $this->rootPath . 'src/' . $configData['classPath'] . $class . '.php';

		if(!file_exists($file)) {
			throw new ApplicationException(sprintf("Class file '%s' for plugin '%s' not found.", $file, $pluginId));
		}

		require $file;
		
		// create instance

		$plugin = new $class;
		
		// check whether instance implements SubscriberInterface
		
		if(!$plugin instanceof SubscriberInterface) {
			throw new ApplicationException(sprintf("Plugin '%s' (class %s) does not implement the SubscriberInterface.", $pluginId, $class));
		}
		
		// set parameters
		
		if(!empty($configData['parameters'])) {

			if(!method_exists($plugin, 'setParameters')) {
				throw new ApplicationException(sprintf("Plugin '%s' (class %s) does not provide a 'setParameters' method but has parameters configured.", $pluginId, $class));
			}
			
			$plugin->setParameters($configData['parameters']);
		}

		// register plugin with dispatcher

		EventDispatcher::getInstance()->addSubscriber($plugin);
		
		return $plugin;

	}
1309393
public function Initialize() {
      $this->Head = new HeadModule($this);
      $this->AddJsFile('jquery.js');
      $this->AddJsFile('jquery.livequery.js');
      $this->AddJsFile('jquery.form.js');
      $this->AddJsFile('jquery.popup.js');
      $this->AddJsFile('jquery.gardenhandleajaxform.js');
      $this->AddJsFile('global.js');
      $this->AddCssFile('admin.css');
      $this->MasterView = 'empty';
      parent::Initialize();
   }
21311
protected static function _init()
    {
        if (static::$_initialized) {
            return;
        }

        static::$_detectors['plugin'] = function ($package) {
            return static::_getPlugin($package);
        };

        static::$_detectors['library'] = function ($package) {
            return static::_getLibrary($package);
        };

        static::$_detectors['thirdParty'] = function ($package) {
            return static::_getThirdParty($package);
        };

        static::$_initialized = true;
    }
648851
public function initialize()
    {
        $menuManager = $this->framework->getInstance('\\Zepi\\Web\\General\\Manager\\MenuManager');

        $menuEntry = new \Zepi\Web\General\Entity\ProtectedMenuEntry(
            'administration',
            'Administration',
            '\\Global\\Administrator',
            'administration',
            'mdi-settings',
            '',
            'self',
            true
        );
        $menuManager->addMenuEntry('menu-right', $menuEntry);
    }
858482
private void init() {
        setTitle("Validation Framework Test");
        setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);

        // Create content pane
        JPanel contentPane = new JPanel(new MigLayout("fill, wrap 2", "[]related[grow]",
                "[]related[]related[]related[]unrelated[]"));
//		contentPane.setBorder(new EmptyBorder(50, 50, 50, 50));
//		setContentPane(new JScrollPane(contentPane));
        setContentPane(contentPane);

        // Input fields
        contentPane.add(new JLabel("Tooltip:"));
        JTextField textField1 = new JTextField();
        contentPane.add(textField1, "growx");
        contentPane.add(new JLabel("Color:"));
        JTextField textField2 = new JTextField();
        contentPane.add(textField2, "growx");
        contentPane.add(new JLabel("Icon:"));
        JTextField textField3 = new JTextField();
        contentPane.add(textField3, "growx");
        contentPane.add(new JLabel("Icon with tooltip:"));

        NumberFormat courseFormat = NumberFormat.getIntegerInstance();
        courseFormat.setMinimumIntegerDigits(3);
        courseFormat.setMaximumIntegerDigits(4);
        courseFormat.setMaximumFractionDigits(0);
        NumberFormatter courseFormatter = new NumberFormatter(courseFormat);
        courseFormatter.setMinimum(0.0);
        courseFormatter.setMaximum(359.0);
        JFormattedTextField formattedTextField4 = new JFormattedTextField(courseFormatter);
        contentPane.add(formattedTextField4, "growx");

        contentPane.add(new JLabel("Icon with tooltip:"));

        courseFormat = NumberFormat.getIntegerInstance();
        courseFormat.setMinimumIntegerDigits(3);
        courseFormat.setMaximumIntegerDigits(4);
        courseFormat.setMaximumFractionDigits(0);
        courseFormatter = new NumberFormatter(courseFormat);
        courseFormatter.setMinimum(0.0);
        courseFormatter.setMaximum(359.0);
        JFormattedTextField formattedTextField5 = new JFormattedTextField(courseFormatter);
        contentPane.add(formattedTextField5, "growx");

        // Apply button
        JButton applyButton = new JButton("Apply");
        contentPane.add(applyButton, "growx, span");

        // Set size
        pack();
        Dimension size = getSize();
        size.width += 100;
        setMinimumSize(size);

        // Set location
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        setLocation((screenSize.width - size.width) / 2, (screenSize.height - size.height) / 3);

        // Create validators
        ResultCollector<InputFieldResult, Boolean> resultCollector1 = new ResultCollector<InputFieldResult,
                Boolean>(new InputFieldResultToBooleanTransformer());
        ResultCollector<InputFieldResult, Boolean> resultCollector2 = new ResultCollector<InputFieldResult,
                Boolean>(new InputFieldResultToBooleanTransformer());
        ResultCollector<InputFieldResult, Boolean> resultCollector3 = new ResultCollector<InputFieldResult,
                Boolean>(new InputFieldResultToBooleanTransformer());
        ResultCollector<Boolean, Boolean> resultCollector4 = new ResultCollector<Boolean, Boolean>();
        ResultCollector<Boolean, Boolean> resultCollector5 = new ResultCollector<Boolean, Boolean>();
        createValidator1(textField1, resultCollector1);
        createValidator2(textField2, resultCollector2);
        createValidator3(textField3, resultCollector3);
        createValidator4(formattedTextField4, resultCollector4);
        createValidator4(formattedTextField5, resultCollector5);

        // Create global validator
        collect(resultCollector1) //
                .collect(resultCollector2) //
                .collect(resultCollector3) //
                .collect(resultCollector4) //
                .collect(resultCollector5) //
                .check(new AndBooleanRule()) //
                .handleWith(new ComponentEnablingBooleanResultHandler(applyButton));
    }
1227789
protected function init()
    {
        $this->pluginManager = PluginManager::instance();
        $this->themeManager = class_exists(ThemeManager::class) ? ThemeManager::instance() : null;
        $this->versionManager = VersionManager::instance();
        $this->tempDirectory = temp_path();
        $this->baseDirectory = base_path();
        $this->disableCoreUpdates = Config::get('cms.disableCoreUpdates', false);
        $this->bindContainerObjects();

        /*
         * Ensure temp directory exists
         */
        if (!File::isDirectory($this->tempDirectory)) {
            File::makeDirectory($this->tempDirectory, 0777, true);
        }
    }
181448
public function Initialize() {
      $this->Head = new HeadModule($this);
      $this->Head->AddTag('meta', array('name' => 'robots', 'content' => 'noindex'));
      
      $this->AddJsFile('jquery.js');
      $this->AddJsFile('jquery.livequery.js');
      $this->AddJsFile('jquery.form.js');
      $this->AddJsFile('jquery.popup.js');
      $this->AddJsFile('jquery.gardenhandleajaxform.js');
      $this->AddJsFile('global.js');
      
      $this->AddCssFile('style.css');
      parent::Initialize();
      Gdn_Theme::Section('Entry');
   }
66590
public function init()
    {
        $this->assets = array(
            'js' => YII_DEBUG ? 'foundation/foundation.section.js' : 'foundation.min.js'
        );

        Html::addCssClass($this->htmlOptions, Enum::SECTION_CONTAINER);
        Html::addCssClass($this->htmlOptions, $this->style);
        ArrayHelper::addValue('data-section', $this->style, $this->htmlOptions);
        $this->registerClientScript();
        parent::init();
    }
1283700
function init()
    {
        $this->_a['table'] = 'cms_contents';
        $this->_a['cols'] = array(
            // Identifier
            'id' => array(
                'type' => 'Pluf_DB_Field_Sequence',
                'is_null' => false,
                'editable' => false
            ),
            // Fields
            'name' => array(
                'type' => 'Pluf_DB_Field_Varchar',
                'is_null' => false,
                'size' => 64,
                'unique' => true,
                'editable' => true
            ),
            'title' => array(
                'type' => 'Pluf_DB_Field_Varchar',
                'is_null' => true,
                'size' => 250,
                'default' => '',
                'editable' => true
            ),
            'description' => array(
                'type' => 'Pluf_DB_Field_Varchar',
                'is_null' => true,
                'size' => 2048,
                'default' => 'auto created content',
                'editable' => true
            ),
            'mime_type' => array(
                'type' => 'Pluf_DB_Field_Varchar',
                'is_null' => true,
                'size' => 64,
                'default' => 'application/octet-stream',
                'editable' => true
            ),
            'media_type' => array(
                'type' => 'Pluf_DB_Field_Varchar',
                'is_null' => true,
                'size' => 64,
                'default' => 'application/octet-stream',
                'verbose' => 'Media type',
                'help_text' => 'This types allow you to category contents',
                'editable' => true
            ),
            'file_path' => array(
                'type' => 'Pluf_DB_Field_Varchar',
                'is_null' => false,
                'size' => 250,
                'verbose' => 'File path',
                'help_text' => 'Content file path',
                'editable' => false,
                'readable' => false
            ),
            'file_name' => array(
                'type' => 'Pluf_DB_Field_Varchar',
                'is_null' => false,
                'size' => 250,
                'default' => 'unknown',
                'verbose' => 'file name',
                'help_text' => 'Content file name',
                'editable' => false
            ),
            'file_size' => array(
                'type' => 'Pluf_DB_Field_Integer',
                'is_null' => false,
                'default' => 'no title',
                'verbose' => 'file size',
                'help_text' => 'content file size',
                'editable' => false
            ),
            'downloads' => array(
                'type' => 'Pluf_DB_Field_Integer',
                'is_null' => false,
                'default' => 0,
                'help_text' => 'content downloads number',
                'editable' => false
            ),
            'status' => array(
                'type' => 'Pluf_DB_Field_Varchar',
                'is_null' => true,
                'size' => 64,
                'default' => 'published',
                'editable' => false
            ),
            'password' => array(
                'type' => 'Pluf_DB_Field_Password',
                'is_null' => true,
                'size' => 150,
                'help_text' => __('Format: [algo]:[salt]:[hash]'),
                'editable' => false,
                'readable' => false
            ),
            'comment_status' => array(
                'type' => 'Pluf_DB_Field_Varchar',
                'is_null' => true,
                'size' => 64,
                'default' => NULL,
                'editable' => false
            ),
            'comment_count' => array(
                'type' => 'Pluf_DB_Field_Integer',
                'is_null' => false,
                'default' => 0,
                'help_text' => 'number of comments on the content',
                'editable' => false
            ),
            'creation_dtime' => array(
                'type' => 'Pluf_DB_Field_Datetime',
                'blank' => true,
                'verbose' => 'creation',
                'help_text' => 'content creation time',
                'editable' => false
            ),
            'modif_dtime' => array(
                'type' => 'Pluf_DB_Field_Datetime',
                'blank' => true,
                'verbose' => 'modification',
                'help_text' => 'content modification time',
                'editable' => false
            ),
            /*
             * Foreign keys
             */
            'author_id' => array(
                'type' => 'Pluf_DB_Field_Foreignkey',
                'model' => 'User_Account',
                'is_null' => false,
                'name' => 'author',
                'relate_name' => 'cms_contents',
                'graphql_name' => 'author',
                'editable' => false
            ),
            'parent_id' => array(
                'type' => 'Pluf_DB_Field_Foreignkey',
                'model' => 'CMS_Content',
                'is_null' => true,
                'name' => 'parent',
                'graphql_name' => 'parent',
                'relate_name' => 'children',
                'editable' => true,
                'readable' => true
            ),
        );

        $this->_a['idx'] = array(
            // @Note: hadi - 1396-10: when define an attribute as 'unique => true', pluf automatically
            // create an unique index for it (for example 'name' field here).
            'content_mime_filter_idx' => array(
                'col' => 'mime_type',
                'type' => 'normal', // normal, unique, fulltext, spatial
                'index_type' => '', // hash, btree
                'index_option' => '',
                'algorithm_option' => '',
                'lock_option' => ''
            )
        );
    }
677005
private void init() {
        setTitle("Validation Framework Test");
        setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);

        // Create content pane
        JPanel contentPane = new JPanel(new MigLayout("fill, wrap 1", "[]", "[]related[]unrelated[]unrelated[]"));
        setContentPane(contentPane);

        // Checkbox to enable the tabbed pane
        JCheckBox tabbedPaneEnabledCheckBox = new JCheckBox("Enable tabbed pane");
        tabbedPaneEnabledCheckBox.setSelected(true);
        contentPane.add(tabbedPaneEnabledCheckBox);
        JCheckBox firstTabEnabledCheckBox = new JCheckBox("Enable first tab");
        firstTabEnabledCheckBox.setSelected(false);
        contentPane.add(firstTabEnabledCheckBox);

        // Tabbed pane
        final JTabbedPane tabbedPane = new JTabbedPane();
        contentPane.add(tabbedPane, "grow");

        // Create tabs
        CompositeReadableProperty<Boolean> tabbedPaneResultsProperty = new CompositeReadableProperty<Boolean>();
        for (int i = 0; i < 3; i++) {
            CompositeReadableProperty<Boolean> tabResultsProperty = new CompositeReadableProperty<Boolean>();
            tabbedPane.add("Tab " + i, createTabContent(tabResultsProperty));
            tabbedPaneResultsProperty.addProperty(installTabValidation(tabbedPane, i, tabResultsProperty));
            tabbedPane.setTitleAt(i, "Tab");
        }

        // Enable tabbed pane only if checkbox is selected
        read(new JToggleButtonSelectedProperty(tabbedPaneEnabledCheckBox)) //
                .write(new ComponentEnabledProperty(tabbedPane));

        // Enable first tab only if checkbox is selected
        read(new JToggleButtonSelectedProperty(firstTabEnabledCheckBox)) //
                .write(new WritableProperty<Boolean>() {
                    @Override
                    public void setValue(Boolean value) {
                        if (tabbedPane.getTabCount() > 0) {
                            tabbedPane.setEnabledAt(0, (value != null) && value);
                        }
                    }
                });

        // Install global validator
        installGlobalValidation(tabbedPaneResultsProperty, applyButton);

        // Apply button
        contentPane.add(applyButton, "align right");

        // Set size
        pack();
        Dimension size = getSize();
        size.width += 100;
        setMinimumSize(size);

        // Set location
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        setLocation((screenSize.width - size.width) / 2, (screenSize.height - size.height) / 3);
    }