Ensure that all variables required by Xentriq are defined.
556867
public static function ensureDefines()
    {
        if (defined('DIR_CORE')) {
            return;
        }
        
        // Define directory basenames
        define("DIR_PUBLIC_BASENAME", "public/");
        define("DIR_LIBS_BASENAME", "libs/");
        define("DIR_ADDONS_BASENAME", "addons/");
        define("DIR_DATA_BASENAME", "data/");
        define("DIR_CONTENT_BASENAME", "content/");
        define("DIR_CONFIG_BASENAME", "config/");
        define("DIR_TEMPLATES_BASENAME", "templates/");
        define("DIR_LOCALE_BASENAME", "locale/");
        
        // Define directories
        define(Xentriq::CONST_DIR_ASSUMED_ROOT, dirname(DIR_PUBLIC) . '/', false);
        
        define(Xentriq::CONST_DIR_CORE, dirname(__FILE__) . '/', false);
        define(Xentriq::CONST_DIR_LIBS, str_replace(DIR_PUBLIC_BASENAME, DIR_LIBS_BASENAME, DIR_PUBLIC) . '/');
        define(Xentriq::CONST_DIR_ADDONS, str_replace(DIR_PUBLIC_BASENAME, DIR_ADDONS_BASENAME, DIR_PUBLIC) . '/', false);
        define("DIR_DATA", str_replace(DIR_PUBLIC_BASENAME, DIR_DATA_BASENAME, DIR_PUBLIC) . '/', false);
        define("DIR_CONTENT", str_replace(DIR_PUBLIC_BASENAME, DIR_CONTENT_BASENAME, DIR_PUBLIC) . '/', false);
        define("DIR_CONFIG", str_replace(DIR_PUBLIC_BASENAME, DIR_CONFIG_BASENAME, DIR_PUBLIC) . '/', false);
        
        define("DIR_TEMPLATES", DIR_CONTENT . DIR_TEMPLATES_BASENAME);
        
        define("DIR_LOCALE", DIR_CORE . DIR_LOCALE_BASENAME);
        define("DIR_LOCALE_PROJECT", DIR_CONTENT . DIR_LOCALE_BASENAME);
        
        // Define extensions
        define("EXT_PAGE", ".xpage");
        define("EXT_PART", ".xpart");
        define("TEMPLATE_INDEX", 'index.xpage');
        
        define("EXT_CSS", ".css");
        define("EXT_SCSS", ".scss");
        define("EXT_SASS", ".sass");
        define("EXT_JS", ".js");
        define("EXT_PHP", ".php");
        define("EXT_XML", ".xml");
        define("EXT_JSON", ".json");
        define("EXT_AUTH", ".auth");
        
        // Define characters
        define("CHAR_SPACE", ' ');
        define("CHAR_CRLF", "\r\n");
        define("CHAR_SLASH", '/');
        define("CHAR_BACKSLASH", '\\');
        define("CHAR_OB", '[');
        define("CHAR_CB", ']');
        define("CHAR_OCB", '(');
        define("CHAR_CCB", ')');
        define("CHAR_OSB", '{');
        define("CHAR_CSB", '}');
        define("CHAR_SEMICOLON", ';');
        define("CHAR_QUOTE", '\'');
        define("CHAR_DOUBLE_QUOTE", '"');
        define("CHAR_BACKTICK", '`');
        
        define("GZIP_SUPPORTED", (substr_count(ArrayUtils::getArrayValueForKeyOrDefault($_SERVER, 'HTTP_ACCEPT_ENCODING', ''), 'gzip') > 0));
        
        // Define environment, defaults to `default`
        define("XENTRIQ_ENVIRONMENT", Utils::getEnvironmentVariable("XENTRIQ_ENVIRONMENT", "default"));
        
        // Define base DEBUG value to ensure proper output.
        define(Xentriq::CONST_DEBUG, Utils::getEnvironmentVariable(Xentriq::CONST_DEBUG, false), true);
        
        // Try to load configuration values from JSON configuration
        define(Xentriq::CONST_DEBUG, Config::getConfigurationValue('debug'));
        
        define("INDEX_FILE", 'index.php');
        define("USE_INDEX_FILE", Config::getConfigurationValueOrDefault('useIndexPhp', false));
        
        define("DISABLE_GZIP", Config::getConfigurationValueOrDefault('disableGzip', false));
        
        define("DISABLE_DEFAULT_RESPONSE_HEADERS", Config::getConfigurationValueOrDefault('disableDefaultResponseHeaders', false));
        
        define("URL_SITE", Request::getSiteUrl());
    }
545666
public function prepareVars()
    {
        $this->page['user'] = $this->user();
        $this->page['canRegister'] = $this->canRegister();
        $this->page['loginAttribute'] = $this->loginAttribute();
        $this->page['loginAttributeLabel'] = $this->loginAttributeLabel();
    }
525630
private function buildVariableDefinitions() {
        foreach($this->getFields() as $field) {
            $variable = new Object\Variable();
            $variable->setName($field->getShortName());
            $variable->setAccess('protected');
            $variable->setAutoIncrementing($field->isAutoIncrementing());
            $variable->setDescription($field->getDescription());
            $variable->setLength($field->getLength());
            $variable->setNullable($field->isNullable());
            $variable->setPrimary($field->isPrimary());
            $variable->setType($field->getType());
            $this->getAbstractClass()->addVariable($variable);
        }
    }
115049
def _validate(self):
        
        variable_names, _unused = getExprNames(self._expr, {})
        expr_indices = []
        for name in variable_names:
            if name == 'inf':
                continue
            match = _VARIABLE_NAME_RE.match(name)
            if not match:
                raise ValueError("%r is not a valid variable name" % name)
            expr_indices.append(int(match.group(2)))

        expr_indices.sort()
        expected_indices = list(range(len(self.inputs)))
        if expr_indices != expected_indices:
            raise ValueError(
                "Expected %s for variable indices, but got %s" % (
                    expected_indices, expr_indices,
                )
            )
        super(NumericalExpression, self)._validate()
388938
def init_vars(self, S, dimK):
        """"""

        Nv = S.shape[0:self.dimN]
        if self.cri is None or Nv != self.cri.Nv:
            self.cri = cr.CDU_ConvRepIndexing(self.dsz, S, dimK, self.dimN)
            if self.opt['CUDA_CBPDN']:
                if self.cri.Cd > 1 or self.cri.Cx > 1:
                    raise ValueError('CUDA CBPDN solver can only be used for '
                                     'single channel problems')
                if self.cri.K > 1:
                    raise ValueError('CUDA CBPDN solver can not be used with '
                                     'mini-batches')
            self.Df = sl.pyfftw_byte_aligned(sl.rfftn(self.D, self.cri.Nv,
                                                      self.cri.axisN))
            self.Gf = sl.pyfftw_empty_aligned(self.Df.shape, self.Df.dtype)
            self.Z = sl.pyfftw_empty_aligned(self.cri.shpX, self.dtype)
        else:
            self.Df[:] = sl.rfftn(self.D, self.cri.Nv, self.cri.axisN)
1178530
public function prepareVars()
    {
        $this->vars['name'] = $this->formField->getName();
        $this->vars['value'] = $this->getLoadValue();
        $this->vars['field'] = $this->formField;
    }
157481
public function prepareVars()
    {
        $this->defineFilterScopes();
        $this->vars['cssClasses'] = implode(' ', $this->cssClasses);
        $this->vars['scopes'] = $this->allScopes;
    }
1158162
private static function ensureKeyPair()
    {
        $publicKeyLocation = DIR_DATA . 'xentriq/security/xentriq.security.website.pub';
        $privateKeyLocation = DIR_DATA . 'xentriq/security/xentriq.security.website.priv';
        
        if (!file_exists($publicKeyLocation) || !file_exists($privateKeyLocation)) {
            $privateKey = openssl_pkey_new(array(
                'private_key_bits' => 2048
            ));
            
            File::setContent($privateKeyLocation, '', true);
            if (!openssl_pkey_export_to_file($privateKey, $privateKeyLocation)) {
                throw new SecurityException('Unable to generate security token');
            }
            
            $privateKeyDetails = openssl_pkey_get_details($privateKey);
            File::setContent($publicKeyLocation, $privateKeyDetails['key'], true);
        }
    }
476861
def ensure_params(kty, provided, required):
    """"""
    if not required <= provided:
        missing = required - provided
        raise MissingValue('Missing properties for kty={}, {}'.format(kty, str(list(missing))))
672754
private function processDeferredIdentificationVariables()
    {
        foreach ($this->deferredIdentificationVariables as $deferredItem) {
            $identVariable = $deferredItem['expression'];

            // Check if IdentificationVariable exists in queryComponents
            if ( ! isset($this->queryComponents[$identVariable])) {
                $this->semanticalError(
                    "'$identVariable' is not defined.", $deferredItem['token']
                );
            }

            $qComp = $this->queryComponents[$identVariable];

            // Check if queryComponent points to an AbstractSchemaName or a ResultVariable
            if ( ! isset($qComp['metadata'])) {
                $this->semanticalError(
                    "'$identVariable' does not point to a Class.", $deferredItem['token']
                );
            }

            // Validate if identification variable nesting level is lower or equal than the current one
            if ($qComp['nestingLevel'] > $deferredItem['nestingLevel']) {
                $this->semanticalError(
                    "'$identVariable' is used outside the scope of its declaration.", $deferredItem['token']
                );
            }
        }
    }
510720
public function prepareVars()
    {
        $this->vars['cssClasses'] = implode(' ', $this->cssClasses);
        $this->vars['placeholder'] = Lang::get($this->prompt);
        $this->vars['value'] = $this->getActiveTerm();
        $this->vars['searchOnEnter'] = $this->searchOnEnter;
    }
63277
def ready(self):
        """"""

        self.log('Got', len(schemastore), 'data and',
                 len(configschemastore), 'component schemata.', lvl=debug)
733769
public function beforeCompile(): void
	{
		$config = $this->validateConfig($this->defaults);

		$definitions = $config['all'] === true
			? $this->getContainerBuilder()->getDefinitions()
			: array_map(
				[$this->getContainerBuilder(), 'getDefinition'],
				array_keys($this->getContainerBuilder()->findByTag(self::TAG_INJECT_VALUE))
			);

		foreach ($definitions as $def) {
			// If class is not defined, then skip it
			if ($def->getType() === null) continue;

			// Inject @value into definitin
			$this->inject($def);
		}
	}
660881
def _vars_match(self):
        """"""
        return re.compile(
            r'#([A-Za-z]+)'  # match literal (#App) at beginning of String
            r':([\d]+)'  # app id (:7979)
            r':([A-Za-z0-9_\.\-\[\]]+)'  # variable name (:variable_name)
            r'!(StringArray|BinaryArray|KeyValueArray'  # variable type (array)
            r'|TCEntityArray|TCEnhancedEntityArray'  # variable type (array)
            r'|String|Binary|KeyValue|TCEntity|TCEnhancedEntity'  # variable type
            r'|(?:(?!String)(?!Binary)(?!KeyValue)'  # non matching for custom
            r'(?!TCEntity)(?!TCEnhancedEntity)'  # non matching for custom
            r'[A-Za-z0-9_-]+))'  # variable type (custom)
        )
490540
def add_variables(vars)
      # Allocate space for the new variables
      ret = LPSolve.resize_lp(@ptr, @constraints.length,
                              @variables.length + vars.length)
      fail if ret != 1

      # Store all the variables in the model
      vars.each { |var| store_variable var }
    end
1178806
def declare_selfvars(self):
        
        self._dictErr = {
            'inputDirFail'   : {
                'action'        : 'trying to check on the input directory, ',
                'error'         : 'directory not found. This is a *required* input',
                'exitCode'      : 1},
            'inputReadCallback' : {
                'action'        : 'checking on the status of the inputReadCallback return, ',
                'error'         : 'no boolean "status" was found. This is a *required* return key',
                'exitCode'      : 2},
            'analysisCallback'  : {
                'action'        : 'checking on the status of the analysisCallback return, ',
                'error'         : 'no boolean "status" was found. This is a *required* return key',
                'exitCode'      : 3},
            'outputWriteCallback' : {
                'action'        : 'checking on the status of the outputWriteCallback return, ',
                'error'         : 'no boolean "status" was found. This is a *required* return key',
                'exitCode'      : 4}
            }

        #
        # Object desc block
        #
        self.str_desc                   = ''
        self.__name__                   = "pftree"
        self.str_version                = "2.0.0"

        # Object containing this class
        self.within                     = None

        # Thread number
        self.numThreads                 = 1

        # Directory and filenames
        self.str_inputDir               = ''
        self.str_inputFile              = ''
        self.str_outputDir              = ''
        self.d_inputTree                = {}
        self.d_inputTreeCallback        = {}
        self.d_outputTree               = {}
        self.str_outputLeafDir          = ''
        self.maxdepth                   = -1

        # Flags
        self.b_persistAnalysisResults   = False
        self.b_relativeDir              = False
        self.b_stats                    = False
        self.b_statsReverse             = False
        self.b_jsonStats                = False
        self.b_json                     = False
        self.b_test                     = False
        self.b_followLinks              = False
        self.str_sleepLength            = ''
        self.f_sleepLength              = 0.0
        self.testType                   = 0

        self.dp                         = None
        self.log                        = None
        self.tic_start                  = 0.0
        self.pp                         = pprint.PrettyPrinter(indent=4)
        self.verbosityLevel             = 1
630354
def intrinsic_variables(xmrs):
    """"""
    ivs = set(
        ep.intrinsic_variable for ep in xmrs.eps()
        if not ep.is_quantifier() and ep.intrinsic_variable is not None
    )
    return sorted(ivs, key=var_id)