Initialize transliterations, datetime dictionary and languages array.
969209
public static function initialize()
    {
        self::$_dictionary = array();

        // Load default datetime strings
        if (empty(self::$_datetime_dictionary)) {
            self::$_datetime_dictionary = include LANG . '/datetime.php';
        }

        // Load default transliterations
        if (empty(self::$_transliterations)) {
            self::$_transliterations = include LANG . '/transliterations.php';
        }

        // Load default English language
        if (empty(self::$_languages)) {
            self::$_languages = self::createLanguage('en', 'English', 'english');
        }

        // Fetch all available languages
        self::fetch();
    }
277880
def compile_dictionary(self, lang, wordlists, encoding, output):
        """"""

        cmd = [
            self.binary,
            '--lang', lang,
            '--encoding', codecs.lookup(filters.PYTHON_ENCODING_NAMES.get(encoding, encoding).lower()).name,
            'create',
            'master', output
        ]

        wordlist = ''

        try:
            output_location = os.path.dirname(output)
            if not os.path.exists(output_location):
                os.makedirs(output_location)
            if os.path.exists(output):
                os.remove(output)

            self.log("Compiling Dictionary...", 1)
            # Read word lists and create a unique set of words
            words = set()
            for wordlist in wordlists:
                with open(wordlist, 'rb') as src:
                    for word in src.read().split(b'\n'):
                        words.add(word.replace(b'\r', b''))

            # Compile wordlist against language
            util.call(
                [
                    self.binary,
                    '--lang', lang,
                    '--encoding=utf-8',
                    'create',
                    'master', output
                ],
                input_text=b'\n'.join(sorted(words)) + b'\n'
            )
        except Exception:
            self.log(cmd, 0)
            self.log("Current wordlist: '%s'" % wordlist, 0)
            self.log("Problem compiling dictionary. Check the binary path and options.", 0)
            raise
1008241
def _from_dict(cls, _dict):
        """"""
        args = {}
        if 'languages' in _dict:
            args['languages'] = [
                IdentifiableLanguage._from_dict(x)
                for x in (_dict.get('languages'))
            ]
        else:
            raise ValueError(
                'Required property \'languages\' not present in IdentifiableLanguages JSON'
            )
        return cls(**args)
1242637
def init():
    

    if settings.USE_L10N:
        locale = settings.LANGUAGE_CODE.replace('-', '_')
        try:
            humanize.i18n.activate(locale)
        except FileNotFoundError:
            pass  # Just let it to the default locale

    HUMANIZE_FUNC_LIST = [
        'naturalday',
        'naturaltime',
        'ordinal',
        'intword',
        'naturaldelta',
        'intcomma',
        'apnumber',
        'fractional',
        'naturalsize',
        'naturaldate'
    ]

    # registers all humanize functions as template tags
    for funcname in HUMANIZE_FUNC_LIST:
        func = getattr(humanize, funcname)
        register.filter(funcname, func, is_safe=True)
480581
private function _initLanguageArrays()
    {
        $this->_scanningProject();

        $languageSources = LanguageSource::find()->all();

        foreach ($languageSources as $languageSource) {
            if (isset($this->_languageElements[$languageSource->category][$languageSource->message])) {
                unset($this->_languageElements[$languageSource->category][$languageSource->message]);
            } else {
                $this->_removableLanguageSourceIds[$languageSource->id] = $languageSource->id;
            }
        }
    }
791771
protected function initializeResouces()
    {
        if ($this->resources !== null) {
            return;
        }

        $this->resources = array();

        $contents = dir($this->root . $this->path);
        while (($path = $contents->read()) !== false) {
            if (in_array($path, array('.', '..', '.hg'))) {
                continue;
            }

            $this->resources[] = (is_dir($this->root . $this->path . $path) ?
                new \Arbit\VCSWrapper\HgCli\Directory($this->root, $this->path . $path . '/') :
                new \Arbit\VCSWrapper\HgCli\File($this->root, $this->path . $path)
            );
        }

        $contents->close();
    }
1125165
function init()
    {
        $this->_a['table'] = 'cms_terms';
        $this->_a['cols'] = array(
            // ID
            'id' => array(
                'type' => 'Pluf_DB_Field_Sequence',
                'blank' => false,
                'verbose' => 'first name',
                'help_text' => 'id',
                'editable' => false
            ),
            // Fields
            'name' => array(
                'type' => 'Pluf_DB_Field_Varchar',
                'is_null' => false,
                'size' => 200,
                'default' => '',
                'editable' => true
            ),
            'slug' => array(
                'type' => 'Pluf_DB_Field_Varchar',
                'is_null' => false,
                'size' => 200,
                'default' => '',
                'editable' => true
            ),
            /*
             * Foreign keys
             */
        );
    }
705754
def _initialize_from_dict(self, data):
        
        self._json = data
        self._validate()

        for name, value in self._json.items():
            if name in self._properties:
                if '$ref' in self._properties[name]:
                    if 'decimal' in self._properties[name]['$ref']:
                        value = Decimal(value)

                # applying proper formatting when required
                if 'format' in self._properties[name]:
                    format = self._properties[name]['format']

                    if 'date-time' == format:
                        value = utils.string_to_datetime(value)
                    elif 'date' == format:
                        value = utils.string_to_date(value)
                setattr(self, name, value)
1247748
public static function initialize() {
		/** @var $instance t3lib_l10n_Locales */
		$instance = t3lib_div::makeInstance('t3lib_l10n_Locales');
		$instance->isoMapping = array_flip($instance->isoReverseMapping);

			// Allow user-defined locales
		if (isset($GLOBALS['TYPO3_CONF_VARS']['SYS']['localization']['locales']['user']) && is_array($GLOBALS['TYPO3_CONF_VARS']['SYS']['localization']['locales']['user'])) {
			foreach ($GLOBALS['TYPO3_CONF_VARS']['SYS']['localization']['locales']['user'] as $locale => $name) {
				if (!isset($instance->languages[$locale])) {
					$instance->languages[$locale] = $name;
				}
			}
		}

			// Initializes the locale dependencies with TYPO3 supported locales
		$instance->localeDependencies = array();
		foreach ($instance->languages as $locale => $name) {
			if (strlen($locale) == 5) {
				$instance->localeDependencies[$locale] = array(substr($locale, 0, 2));
			}
		}
			// Merge user-provided locale dependencies
		if (isset($GLOBALS['TYPO3_CONF_VARS']['SYS']['localization']['locales']['dependencies']) && is_array($GLOBALS['TYPO3_CONF_VARS']['SYS']['localization']['locales']['dependencies'])) {
			$instance->localeDependencies = t3lib_div::array_merge_recursive_overrule($instance->localeDependencies, $GLOBALS['TYPO3_CONF_VARS']['SYS']['localization']['locales']['dependencies']);
		}

		/**
		 * @deprecated since TYPO3 4.6, will be removed in TYPO3 6.0
		 */
		$instance->locales = array_keys($instance->languages);

		/**
		 * @deprecated since TYPO3 4.6, will be removed in TYPO3 6.0
		 */
		define('TYPO3_languages', implode('|', $instance->getLocales()));
	}
166513
def init_from_datastore(self):
    """"""
    self._data = {}
    for entity in self._datastore_client.query_fetch(
        kind=self._entity_kind_batches):
      batch_id = entity.key.flat_path[-1]
      self._data[batch_id] = dict(entity)
      self._data[batch_id]['images'] = {}
    for entity in self._datastore_client.query_fetch(
        kind=self._entity_kind_images):
      batch_id = entity.key.flat_path[-3]
      image_id = entity.key.flat_path[-1]
      self._data[batch_id]['images'][image_id] = dict(entity)
1039854
protected static function _initDictionary()
    {
        if (null === (self::$_texts = \App\Registry::$cache->load('Cms-text'))) {
            self::$_texts = [];
            foreach ((new Orm\CmsTextQuery)->find() as $text) {
                if ($text->lang === null) {
                    self::$_texts['none'][$text->key] = $text->content;
                    continue;
                }
                self::$_texts[$text->lang][$text->key] = $text->content;
            }
            \App\Registry::$cache->save(self::$_texts, 'Cms-text', 0);
        }
    }
507083
def _init_loaders(self) -> None:
        

        for loader in settings.I18N_TRANSLATION_LOADERS:
            loader_class = import_class(loader['loader'])
            instance = loader_class()
            instance.on_update(self.update)
            run(instance.load(**loader['params']))
824567
protected function createLanguages()
    {
        $this->setCliMessage('Configuring language...');

        if (!empty($this->data['store']['language']) && $this->data['store']['language'] !== 'en') {
            $this->getLanguageModel()->update($this->data['store']['language'], array('default' => true));
        }
    }
403927
def initialize(self):
        """"""
        if self.croniter is None:
            self.time = time.time()
            self.datetime = datetime.now(self.tz)
            self.loop_time = self.loop.time()
            self.croniter = croniter(self.spec, start_time=self.datetime)
554819
def _init_dflt(self):
        """"""
        nts = []
        ntobj = cx.namedtuple('ntanno', self.flds)
        for itemid, gos in self.id2gos.items():
            for goid in gos:
                nts.append(ntobj(DB_ID=itemid, GO_ID=goid))
        return nts
399444
def _init_kws(self, **kws_usr):
        """"""
        kws_self = {}
        user_keys = set(kws_usr)
        for objname, expset in self.exp_keys.items():
            usrkeys_curr = user_keys.intersection(expset)
            kws_self[objname] = get_kwargs(kws_usr, usrkeys_curr, usrkeys_curr)
        dpi = str(kws_self['dag'].get('dpi', self.dflts['dpi']))
        kws_self['dag']['dpi'] = dpi
        return kws_self
354687
def load_with_datetime(pairs):
    """"""
    d = {}
    for k, v in pairs:
        if isinstance(v, basestring):
            try:
                d[k] = dateutil.parser.parse(v)
            except ValueError:
                d[k] = v
        else:
            d[k] = v             
    return d