TODO this method has some weird, undocumented behavior to ignore ngrams with upper case.

Get n-Gram
@param n length of n-gram
@return n-Gram String (null if it is invalid)
334810
@Nullable
    public String get(int n) {
        if (capitalword_) return null;
        int len = grams_.length(); 
        if (n < 1 || n > N_GRAM || len < n) return null;
        if (n == 1) {
            char ch = grams_.charAt(len - 1);
            if (ch == ' ') return null;
            return Character.toString(ch);
        } else {
            return grams_.substring(len - n, len);
        }
    }
1366343
def _get_word_ngrams(n, sentences):
    
    assert len(sentences) > 0
    assert n > 0

    words = _split_into_words(sentences)
    return _get_ngrams(n, words)
1332310
public Geometry getGeometryN(int n) {
		if (isEmpty()) {
			return null;
		}
		if (n >= 0 && n < points.length) {
			return points[n];
		}
		throw new ArrayIndexOutOfBoundsException(n);
		// return this;
	}
608350
public static String stringFor(int n)
    {
        switch (n)
        {
            case NVGRAPH_STATUS_SUCCESS: return "NVGRAPH_STATUS_SUCCESS";
            case NVGRAPH_STATUS_NOT_INITIALIZED: return "NVGRAPH_STATUS_NOT_INITIALIZED";
            case NVGRAPH_STATUS_ALLOC_FAILED: return "NVGRAPH_STATUS_ALLOC_FAILED";
            case NVGRAPH_STATUS_INVALID_VALUE: return "NVGRAPH_STATUS_INVALID_VALUE";
            case NVGRAPH_STATUS_ARCH_MISMATCH: return "NVGRAPH_STATUS_ARCH_MISMATCH";
            case NVGRAPH_STATUS_MAPPING_ERROR: return "NVGRAPH_STATUS_MAPPING_ERROR";
            case NVGRAPH_STATUS_EXECUTION_FAILED: return "NVGRAPH_STATUS_EXECUTION_FAILED";
            case NVGRAPH_STATUS_INTERNAL_ERROR: return "NVGRAPH_STATUS_INTERNAL_ERROR";
            case NVGRAPH_STATUS_TYPE_NOT_SUPPORTED: return "NVGRAPH_STATUS_TYPE_NOT_SUPPORTED";
            case NVGRAPH_STATUS_NOT_CONVERGED: return "NVGRAPH_STATUS_NOT_CONVERGED";
            case NVGRAPH_STATUS_GRAPH_TYPE_NOT_SUPPORTED: return "NVGRAPH_STATUS_GRAPH_TYPE_NOT_SUPPORTED";
            case JNVGRAPH_STATUS_INTERNAL_ERROR: return "JNVGRAPH_STATUS_INTERNAL_ERROR";
        }
        return "INVALID nvgraphStatus: "+n;
    }
732307
public char skip(int n)
  {
    _pos += n;
    
    if (_length <= _pos) {
      _pos = _string.length();
      return DONE;
    } else
      return _string.charAt(_pos);
  }
1153714
def to_ngrams(self, terms):
        ''' 
        '''
        if len(terms) <= self.n:
            return terms
        if self.n == 1:
            n_grams = [[term] for term in terms]
        else:
            n_grams = []
            for i in range(0,len(terms)-self.n+1):
                n_grams.append(terms[i:i+self.n])
        return n_grams
293863
public Expression getArg(int n) {
    if (n >= 0 && n < m_argVec.size())
      return (Expression) m_argVec.elementAt(n);
    else
      return null;
  }
845326
def NgramScorer(frequency_map):
    
    # Calculate the log probability
    length = len(next(iter(frequency_map)))
    # TODO: 0.01 is a magic number. Needs to be better than that.
    floor = math.log10(0.01 / sum(frequency_map.values()))
    ngrams = frequency.frequency_to_probability(frequency_map, decorator=math.log10)

    def inner(text):
        # I dont like this, it is only for the .upper() to work,
        # But I feel as though this can be removed in later refactoring
        text = ''.join(text)
        text = remove(text.upper(), string.whitespace + string.punctuation)
        return sum(ngrams.get(ngram, floor) for ngram in iterate_ngrams(text, length))

    return inner
681785
public static String stringFor(int n)
    {
        switch (n)
        {
            case CU_MEM_ADVISE_SET_READ_MOSTLY : return "CU_MEM_ADVISE_SET_READ_MOSTLY";
            case CU_MEM_ADVISE_UNSET_READ_MOSTLY : return "CU_MEM_ADVISE_UNSET_READ_MOSTLY";
            case CU_MEM_ADVISE_SET_PREFERRED_LOCATION : return "CU_MEM_ADVISE_SET_PREFERRED_LOCATION";
            case CU_MEM_ADVISE_UNSET_PREFERRED_LOCATION : return "CU_MEM_ADVISE_UNSET_PREFERRED_LOCATION";
            case CU_MEM_ADVISE_SET_ACCESSED_BY : return "CU_MEM_ADVISE_SET_ACCESSED_BY";
            case CU_MEM_ADVISE_UNSET_ACCESSED_BY : return "CU_MEM_ADVISE_UNSET_ACCESSED_BY";
        }
        return "INVALID CUmem_advise: "+n;
    }
1325519
def prune_by_ngram_size(self, minimum=None, maximum=None):
        
        self._logger.info('Pruning results by n-gram size')
        if minimum:
            self._matches = self._matches[
                self._matches[constants.SIZE_FIELDNAME] >= minimum]
        if maximum:
            self._matches = self._matches[
                self._matches[constants.SIZE_FIELDNAME] <= maximum]
1215821
@NotNull
    public List<String> extractGrams(@NotNull CharSequence text) {
        text = applyPadding(text);
        int len = text.length();

        //the actual size will be totalNumGrams or less (filter)
        int totalNumGrams = 0;
        for (Integer gramLength : gramLengths) {
            int num = len - (gramLength - 1);
            if (num >= 1) { //yes can be negative
                totalNumGrams += num;
            }
        }
        if (totalNumGrams <= 0) {
            return Collections.emptyList();
        }
        List<String> grams = new ArrayList<>(totalNumGrams);

        for (Integer gramLength : gramLengths) {
            int numGrams = len - (gramLength -1);
            if (numGrams >= 1) { //yes can be negative
                for (int pos=0; pos<numGrams; pos++) {
                    String gram = text.subSequence(pos, pos + gramLength).toString();
                    if (filter==null || filter.use(gram)) {
                        grams.add(gram);
                    }
                }
            }
        }
        return grams;
    }
296900
public static String stringFor(int n)
    {
        switch (n)
        {
            case CURAND_STATUS_SUCCESS: return "CURAND_STATUS_SUCCESS";
            case CURAND_STATUS_VERSION_MISMATCH: return "CURAND_STATUS_VERSION_MISMATCH";
            case CURAND_STATUS_NOT_INITIALIZED: return "CURAND_STATUS_NOT_INITIALIZED";
            case CURAND_STATUS_ALLOCATION_FAILED: return "CURAND_STATUS_ALLOCATION_FAILED";
            case CURAND_STATUS_TYPE_ERROR: return "CURAND_STATUS_TYPE_ERROR";
            case CURAND_STATUS_OUT_OF_RANGE: return "CURAND_STATUS_OUT_OF_RANGE";
            case CURAND_STATUS_LENGTH_NOT_MULTIPLE: return "CURAND_STATUS_LENGTH_NOT_MULTIPLE";
            case CURAND_STATUS_DOUBLE_PRECISION_REQUIRED: return "CURAND_STATUS_DOUBLE_PRECISION_REQUIRED";
            case CURAND_STATUS_LAUNCH_FAILURE: return "CURAND_STATUS_LAUNCH_FAILURE";
            case CURAND_STATUS_PREEXISTING_FAILURE: return "CURAND_STATUS_PREEXISTING_FAILURE";
            case CURAND_STATUS_INITIALIZATION_FAILED: return "CURAND_STATUS_INITIALIZATION_FAILED";
            case CURAND_STATUS_ARCH_MISMATCH: return "CURAND_STATUS_ARCH_MISMATCH";
            case CURAND_STATUS_INTERNAL_ERROR: return "CURAND_STATUS_INTERNAL_ERROR";
        }
        return "INVALID curandStatus";
    }
910528
public long skip(long n) throws IllegalArgumentException, IOException {

        if (lookaheadChar == UNDEFINED) {
            lookaheadChar = super.read();
        }

        // illegal argument
        if (n < 0) {
            throw new IllegalArgumentException("negative argument not supported");
        }

        // no skipping
        if (n == 0 || lookaheadChar == END_OF_STREAM) {
            return 0;
        }

        // skip and reread the lookahead-char
        long skiped = 0;
        if (n > 1) {
            skiped = super.skip(n - 1);
        }
        lookaheadChar = super.read();
        // fixme uh: we should check the skiped sequence for line-terminations...
        lineCounter = Integer.MIN_VALUE;
        return skiped + 1;
    }
543084
public static String repeatQM(int n) {
        N.checkArgNotNegative(n, "count");

        String result = QM_CACHE.get(n);

        if (result == null) {
            result = StringUtil.repeat("?", n, ", ");
        }

        return result;
    }
1045164
public Collection<String> wordsNearest(String word, int n) {
        return modelUtils.wordsNearest(word, n);
    }
38427
public static String stringFor(int n)
    {
        switch (n)
        {
            case cudaGraphicsCubeFacePositiveX: return "cudaGraphicsCubeFacePositiveX";
            case cudaGraphicsCubeFaceNegativeX: return "cudaGraphicsCubeFaceNegativeX";
            case cudaGraphicsCubeFacePositiveY: return "cudaGraphicsCubeFacePositiveY";
            case cudaGraphicsCubeFaceNegativeY: return "cudaGraphicsCubeFaceNegativeY";
            case cudaGraphicsCubeFacePositiveZ: return "cudaGraphicsCubeFacePositiveZ";
            case cudaGraphicsCubeFaceNegativeZ: return "cudaGraphicsCubeFaceNegativeZ";
        }
        return "INVALID cudaGraphicsCubeFace: "+n;
    }
287018
public String cardinal(Long n) {
        return (n == null) ? null : cardinal(n.longValue());
    }