Define and call data for future use. Initializes and defines all
        variables which define the phonetic vectors.
190016
def get_lang_data(self):
        

        root = os.path.expanduser('~')
        csv_dir_path = os.path.join(root, 'cltk_data/sanskrit/model/sanskrit_models_cltk/phonetics')

        all_phonetic_csv = os.path.join(csv_dir_path, 'all_script_phonetic_data.csv')
        tamil_csv = os.path.join(csv_dir_path, 'tamil_script_phonetic_data.csv')

        # Make helper function for this
        with open(all_phonetic_csv,'r') as f:
            reader = csv.reader(f, delimiter = ',', quotechar = '"')
            next(reader, None) # Skip headers
            all_phonetic_data = [row for row in reader]

        with open(tamil_csv,'r') as f:
            reader = csv.reader(f, delimiter = ',', quotechar = '"')
            next(reader, None) # Skip headers
            # tamil_phonetic_data = [row[PHONETIC_VECTOR_START_OFFSET:] for row in reader]
            tamil_phonetic_data = [row for row in reader]

        # Handle better?
        all_phonetic_data = [[int(cell) if cell=='0' or cell=='1' else cell for cell in row] for row in all_phonetic_data]
        tamil_phonetic_data = [[int(cell) if cell=='0' or cell=='1' else cell for cell in row] for row in tamil_phonetic_data]

        all_phonetic_vectors = np.array([row[PHONETIC_VECTOR_START_OFFSET:] for row in all_phonetic_data])
        tamil_phonetic_vectors = np.array([row[PHONETIC_VECTOR_START_OFFSET:] for row in tamil_phonetic_data])

        phonetic_vector_length = all_phonetic_vectors.shape[1]

        return all_phonetic_data, tamil_phonetic_data, all_phonetic_vectors, tamil_phonetic_vectors, phonetic_vector_length
60668
public void buildVocab() {


        val constructor = new VocabConstructor.Builder<T>().addSource(iterator, minWordFrequency)
                        .setTargetVocabCache(vocab).fetchLabels(trainSequenceVectors).setStopWords(stopWords)
                        .enableScavenger(enableScavenger).setEntriesLimit(vocabLimit)
                        .allowParallelTokenization(configuration.isAllowParallelTokenization())
                        .setUnk(useUnknown && unknownElement != null ? unknownElement : null).build();

        if (existingModel != null && lookupTable instanceof InMemoryLookupTable
                        && existingModel.lookupTable() instanceof InMemoryLookupTable) {
            log.info("Merging existing vocabulary into the current one...");
            /*
                if we have existing model defined, we're forced to fetch labels only.
                the rest of vocabulary & weights should be transferred from existing model
             */

            constructor.buildMergedVocabulary(existingModel, true);

            /*
                Now we have vocab transferred, and we should transfer syn0 values into lookup table
             */
            ((InMemoryLookupTable<VocabWord>) lookupTable)
                            .consume((InMemoryLookupTable<VocabWord>) existingModel.lookupTable());
        } else {
            log.info("Starting vocabulary building...");
            // if we don't have existing model defined, we just build vocabulary


            constructor.buildJointVocabulary(false, true);

            /*
            if (useUnknown && unknownElement != null && !vocab.containsWord(unknownElement.getLabel())) {
                log.info("Adding UNK element...");
                unknownElement.setSpecial(true);
                unknownElement.markAsLabel(false);
                unknownElement.setIndex(vocab.numWords());
                vocab.addToken(unknownElement);
            }
            */


            // check for malformed inputs. if numWords/numSentences ratio is huge, then user is passing something weird
            if (vocab.numWords() / constructor.getNumberOfSequences() > 1000) {
                log.warn("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
                log.warn("!                                                                                       !");
                log.warn("! Your input looks malformed: number of sentences is too low, model accuracy may suffer !");
                log.warn("!                                                                                       !");
                log.warn("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
            }
        }


    }
280971
def get_phonetic_feature_vector(self, c, lang):
        """"""

        offset = self.get_offset(c, lang)
        if not self.in_coordinated_range_offset(offset):
            return self.invalid_vector()

        phonetic_data, phonetic_vectors = self.get_phonetic_info(lang)

        # 'Valid Vector Representation' is the [5] column
        if phonetic_data[offset][5] == 0:
            return self.invalid_vector()

        return phonetic_vectors[offset]
49593
public void initializeReferenceData() {
        if (_referenceDataActivationManager == null) {
            return;
        }
        final Collection<Object> referenceDataCollection = _referenceDataActivationManager.getAllReferenceData();
        for (Object referenceData : referenceDataCollection) {
            ComponentDescriptor<? extends Object> descriptor = Descriptors.ofComponent(referenceData.getClass());

            assignProvidedProperties(descriptor, referenceData);
            initialize(descriptor, referenceData);
        }
    }
1270783
def _init_command_data(params)
      # set state
      @state = {
        result: true,
        errors: []
      }

      # set options
      initial_options = {
        exceptions: false,
        nullify_empty_params: false
      }
      default_options = _safe_default_options || {}
      params_options = params[:_options] || {}
      @options = initial_options.merge(default_options)
                                .merge(params_options)

      # set other data
      @params = params
    end
449781
def _eval_variables(self):
        
        for k, v in listitems(self._variables):
            self._variables[k] = v() if hasattr(v, '__call__') else v
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
738245
public void addVariable(VariableInitializer v) {
        assertNotNull(v);
        variables.add(v);
        v.setParent(this);
    }
962401
private void parseDefinition() {
        values = new ArrayList<DSLVariableValue>();
        if (getDefinition() == null) {
            return;
        }

        int variableStart = definition.indexOf("{");
        while (variableStart >= 0) {
            int variableEnd = getIndexForEndOfVariable(definition,
                                                       variableStart);
            String variable = definition.substring(variableStart + 1,
                                                   variableEnd);
            values.add(parseValue(variable));
            variableStart = definition.indexOf("{",
                                               variableEnd);
        }
    }
562943
def _initialize(self):
        """"""

        self.log.debug("Start initializing data from %s",
                       self.url)
        resp = self.get(self.url,
                        verify=False,
                        proxies=self.rtc_obj.proxies,
                        headers=self.rtc_obj.headers)
        self.__initialize(resp)
        self.log.info("Finish the initialization for <%s %s>",
                      self.__class__.__name__, self)
755692
protected function createLexicalVariables() {
    if (!$this->hasLexicalVariables()) {
      $this->lexicalUse = Token::_use();
      $this->lexicalOpenParen = Token::openParen();
      $this->lexicalVariables = new CommaListNode();
      $this->lexicalCloseParen = Token::closeParen();
      $this->closeParen->after([
        Token::space(),
        $this->lexicalUse,
        Token::space(),
        $this->lexicalOpenParen,
        $this->lexicalVariables,
        $this->lexicalCloseParen,
      ]);
    }
  }
417560
protected function initializeResouces()
    {
        $this->resources = array();

        // Build resources array, without constructing the objects yet, for
        // lazy construction of the object tree.
        $directory = new \DirectoryIterator($this->root . $this->path);
        foreach ($directory as $fileInfo) {
            $fileName = $fileInfo->getFilename();
            if (($fileName === '.') ||
                 ($fileName === '..') ||
                 ($fileName === 'CVS'))
            {
                continue;
            }

            $resource = null;
            if ($fileInfo->isDir() === true) {
                $resource = new \Arbit\VCSWrapper\CvsCli\Directory($this->root, $this->path . $fileName . '/');
            } else {
                $resource = new \Arbit\VCSWrapper\CvsCli\File($this->root, $this->path . $fileName);
            }
            $this->resources[] = $resource;
        }
    }
443877
private function initialize()
    {
        $this->entity = '';
        $this->source = '';
        $this->mode = self::RSMODE_NOTCONNECTED;
        $this->result = null;
        $this->originalValues = null;
        $this->datafields = [];
        $this->values = [];
        $this->idFields = [];
    }
184500
private void initArrays() {
        if (data == null || picsize != data.length) {
            data = new int[picsize];
            magnitude = new int[picsize];

            xConv = new float[picsize];
            yConv = new float[picsize];
            xGradient = new float[picsize];
            yGradient = new float[picsize];
        }
    }
24176
protected function InitLanguageFile()
    {
        if ($this->language == null)
            $this->language = new Language();

        $this->InitRecLanguageFile(get_class($this));
    }
928562
private void initVariables() {
		if (this.currentWindow == null) {
			this.currentWindow = new int[this.windowSize];
		}

		if (this.classDistributions == null) {
			this.classDistributions = new long[this.getModelContext().classAttribute().numValues()];
		}
	}
677658
function(locale_data, l) {
    if (typeof(this.data) == 'undefined') {
        this.data = { };
    }

    if (!l) {
        l = this.lang;
    }

    if (typeof this.data[l] == 'undefined') {
        this.data[l] = {};
    }

    var domain;

    // suck in every domain defined in the supplied data
    for (domain in locale_data) {
        // skip empty specs (flexibly)
        if ((! locale_data.hasOwnProperty(domain)) || !locale_data[domain]) {
            continue;
        }
        // skip if it has no msgid's
        var has_msgids = false;
        for (var msgid in locale_data[domain]) {
            has_msgids = true;
            break;
        }
        if (! has_msgids) {
            continue;
        }


        // grab shortcut to data
        var data = locale_data[domain];

        // if they specifcy a blank domain, default to "messages"
        if (domain === "") {
            domain = "messages";
        }
        // init the data structure
        this.data[l][domain]      = this.data[l][domain]      || { };
        this.data[l][domain].head = this.data[l][domain].head || { };
        this.data[l][domain].msgs = this.data[l][domain].msgs || { };

        for (var head in data.headers) {
            var h = head.toLowerCase();
            this.data[l][domain].head[h] = data.headers[head];
        }

        for (var key in data.items) {
            var item = data.items[key];
            this.data[l][domain].msgs[item.msgid] = item;
        }
    }

    // build the plural forms function
    for (domain in this.data[l]) {
        if (this.data[l][domain].head['plural-forms'] &&
            this.data[l][domain].head['plural-forms'].length > 0 &&
            typeof(this.data[l][domain].head.plural_func) == 'undefined') {
            // untaint data
            var plural_forms = this.data[l][domain].head['plural-forms'];
            var pf_re = new RegExp('^(\\s*nplurals\\s*=\\s*[0-9]+\\s*;\\s*plural\\s*=\\s*(?:\\s|[-\\?\\|&=!<>+*/%:;a-zA-Z0-9_\\(\\)])+)', 'm');
            if (pf_re.test(plural_forms)) {
                //ex english: "Plural-Forms: nplurals=2; plural=(n != 1);\n"
                //pf = "nplurals=2; plural=(n != 1);";
                //ex russian: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10< =4 && (n%100<10 or n%100>=20) ? 1 : 2)
                //pf = "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)";

                var pf = this.data[l][domain].head['plural-forms'];
                if (! /;\s*$/.test(pf)) {
                    pf = pf.concat(';');
                }
                /* We used to use eval, but it seems IE has issues with it.
                 * We now use "new Function", though it carries a slightly
                 * bigger performance hit.
                var code = 'function (n) { var plural; var nplurals; '+pf+' return { "nplural" : nplurals, "plural" : (plural === true ? 1 : plural ? plural : 0) }; };';
                this.data[l][domain].head.plural_func = eval("("+code+")");
                */
                var code = 'var plural; var nplurals; '+pf+' return { "nplural" : nplurals, "plural" : (plural === true ? 1 : plural ? plural : 0) };';
                this.data[l][domain].head.plural_func = new Function("n", code);
            } else {
                throw new Error("Syntax error in language file. Plural-Forms header is invalid ["+plural_forms+"]");
            }

        // default to english plural form
        } else if (typeof(this.data[l][domain].head.plural_func) == 'undefined') {
            this.data[l][domain].head.plural_func = function (n) {
                var p = (n != 1) ? 1 : 0;
                return { 'nplural' : 2, 'plural' : p };
            };
        } // else, plural_func already created
    }

    return;
}