Initialize all registered captcha generators and start generating captcha.
166697
static function init() {
        mt_srand();
        foreach (self::$_captchaList as $captcha)
            $captcha->init();
        if (!is_resource(self::$_queue))
            self::_initQueue();
        self::$_timer_id = Timer::add(Config::get('CAPTCHA_TIMER_INTERVAL'), function () {
            $obj = self::_chooseOne();
            if ($obj->getStatus() != $obj::STATUS_INIT)
                return;
            if (msg_stat_queue(self::$_queue)['msg_qnum'] < Config::get('CAPTCHA_CACHE_MAX'))
                self::_chooseOne()->generate();
        });
    }
1340422
private function initializeOnDemand()
    {
        if ($this->initialized === false) {

            $this->initialized = true;
            $this->cache = $this->cacheMapper->fetchAll();

            // Run garbage collection on each HTTP request
            $this->gc();
        }
    }
825339
public function initialize()
    {
        parent::initialize();

        //Loads helpers
        $this->loadHelper('MeTools.BBCode');
        $this->loadHelper('MeTools.Breadcrumbs');
        $this->loadHelper('RecaptchaMailhide.Mailhide');
        $this->loadHelper('MeCms.Widget');
    }
341730
def generate
      generators.each do |generator|
        start = Time.now
        generator.generate(self)
        Bunto.logger.debug "Generating:",
          "#{generator.class} finished in #{Time.now - start} seconds."
      end
    end
1273821
protected void start() {
    if (waterMarkEventGenerator != null) {
      LOG.fine("Starting waterMarkEventGenerator");
      waterMarkEventGenerator.start();
    }
    LOG.fine("Starting trigger policy");
    triggerPolicy.start();
  }
1348246
def generators():
    
    from populous import generators

    base = generators.Generator

    for name in dir(generators):
        generator = getattr(generators, name)

        if isinstance(generator, type) and issubclass(generator, base):
            name = generator.__name__
            doc = (generator.__doc__ or '').strip()

            if doc:
                click.echo("{} - {}".format(name, doc))
            else:
                click.echo(name)
661151
def __init(self):
        """"""
        res = self._get(url=self._url,
                           param_dict={"f": "json"},
                           securityHandler=self._securityHandler,
                           proxy_url=self._proxy_url,
                           proxy_port=self._proxy_port)
        self._json_dict = res
        self._json_string = json.dumps(self._json_dict)
        for k,v in self._json_dict.items():
            setattr(self, k, v)
53271
private void initialize() {
        createKeysIfNotExist();
        if (keyPair == null) {
            try {
                loadKeyPair();
            } catch (IOException | NoSuchAlgorithmException | InvalidKeySpecException e) {
                LOGGER.error("An error occurred loading key pair");
                LOGGER.error(e.getMessage());
            }
        }
        if (secretKey == null) {
            try {
                loadSecretKey();
            } catch (IOException | ClassNotFoundException e) {
                LOGGER.error("An error occurred loading secret key");
                LOGGER.error(e.getMessage());
            }
        }
    }
825894
private function runInitMethods(): void
    {
        $reflectionClass = self::getDoctrineStaticMeta()->getReflectionClass();
        $methods         = $reflectionClass->getMethods(\ReflectionMethod::IS_PRIVATE);
        foreach ($methods as $method) {
            if ($method instanceof ReflectionMethod) {
                $method = $method->getName();
            }
            if (\ts\stringContains($method, UsesPHPMetaDataInterface::METHOD_PREFIX_INIT)
                && \ts\stringStartsWith($method, UsesPHPMetaDataInterface::METHOD_PREFIX_INIT)
            ) {
                $this->$method();
            }
        }
    }
943467
public void init() {
        if(random == null) {
            throw new IllegalArgumentException("init should be called after random number generator set");
        }
		readNames();
        usernameGenerator = initSpewGenerator("username");
        emailGenerator = initSpewGenerator("email");
        initialized = true;
	}
536147
protected function setupEmojiMaps()
    {
        $this->emojiMap = $this->getEmojiMap();
        $this->wordMap = array_flip($this->emojiMap);
    }
215213
public function actionGenerate()
	{
		$passwordList = \App::$domain->tool->password->generate();
		$text = implode(SPC, $passwordList);
		Output::line();
		Output::pipe('Generated passwords');
		Output::autoWrap($text);
		Output::pipe();
		Output::line();
	}
943604
def init():
    """"""

    print("Blended: Static Website Generator -\n")

    checkConfig()

    if (sys.version_info > (3, 0)):
        wname = input("Website Name: ")
        wdesc = input("Website Description: ")
        wlan = input("Website Language: ")
        wlic = input("Website License: ")
        aname = input("Author(s) Name(s): ")
    else:
        wname = raw_input("Website Name: ")
        wdesc = raw_input("Website Description: ")
        wlan = raw_input("Website Language: ")
        wlic = raw_input("Website License: ")
        aname = raw_input("Author(s) Name(s): ")

    createBlendedFolders()

    # Populate the configuration file
    createConfig(app_version=app_version, wname=wname,
                 wdesc=wdesc, wlic=wlic, wlan=wlan, aname=aname)

    print("\nThe required files for your website have been generated.")
994290
public function init()
    {
        if (! empty($this->registry[$this->section])) {
            throw new RegistryException(
                RegistryException::DUPLICATE_INITIATION_ATTEMPT_TEXT . '(section: ' . $this->section . ')',
                RegistryException::DUPLICATE_INITIATION_ATTEMPT_CODE
            );
        }

        $this->registry[$this->section] = array();
    }
218301
protected function addCaptchaElement()
    {
        if (!$this->getCaptchaOptions() || $this->has('captcha')) {
            return;
        }

        $spec = array_replace_recursive($this->captchaElementSpec, [
                'name' => $this->getCaptchaElementName(),
                'options' => [
                    'captcha' => $this->getCaptchaOptions(),
                ],
            ]);

        $this->add($spec, ['priority' => -970]);
    }
921882
def generate_captcha
      if EasyCaptcha.cache
        # create cache dir
        FileUtils.mkdir_p(EasyCaptcha.cache_temp_dir)

        # select all generated captchas from cache
        files = Dir.glob(EasyCaptcha.cache_temp_dir + "*.png")

        unless files.size < EasyCaptcha.cache_size
          file              = File.open(files.at(Kernel.rand(files.size)))
          session[:captcha] = File.basename(file.path, '.*')

          if file.mtime < EasyCaptcha.cache_expire.ago
            File.unlink(file.path)
            # remove speech version
            File.unlink(file.path.gsub(/png\z/, "wav")) if File.exists?(file.path.gsub(/png\z/, "wav"))
          else
            return file.readlines.join
          end
        end
        generated_code = generate_captcha_code
        image = Captcha.new(generated_code).image

        # write captcha for caching
        File.open(captcha_cache_path(generated_code), 'w') { |f| f.write image }

        # write speech file if u create a new captcha image
        EasyCaptcha.espeak.generate(generated_code, speech_captcha_cache_path(generated_code)) if EasyCaptcha.espeak?

        # return image
        image
      else
        Captcha.new(generate_captcha_code).image
      end
    end
1068244
def init_search(self):
        """"""
        if self.verbose:
            logger.info("Initializing search.")
        for generator in self.generators:
            graph = generator(self.n_classes, self.input_shape).generate(
                self.default_model_len, self.default_model_width
            )
            model_id = self.model_count
            self.model_count += 1
            self.training_queue.append((graph, -1, model_id))
            self.descriptors.append(graph.extract_descriptor())

        if self.verbose:
            logger.info("Initialization finished.")