Get `GRAPHEME CLUSTER BREAK` property.
350646
def get_grapheme_cluster_break_property(value, is_bytes=False):
    """"""

    obj = unidata.ascii_grapheme_cluster_break if is_bytes else unidata.unicode_grapheme_cluster_break

    if value.startswith('^'):
        negated = value[1:]
        value = '^' + unidata.unicode_alias['graphemeclusterbreak'].get(negated, negated)
    else:
        value = unidata.unicode_alias['graphemeclusterbreak'].get(value, value)

    return obj[value]
1108291
void getXY(int cluster, Point2D pt) {
		int vindex = getClusterVertexIndex_(cluster);
		m_shape.getXYWithIndex(vindex, pt);
	}
474018
def break_fiber(depth=0):
    """"""
    set_stack_var(SECTION_BOUNDARY_TAG, True, depth=depth+1)
    set_stack_var(SECTION_STATE_TAG, None, depth=depth+1)
460627
private int defaultSentenceBreak(String s) {
        // scan for period followed by whitespace
        int period = -1;
        for (int i = 0; i < s.length(); i++) {
            switch (s.charAt(i)) {
                case '.':
                    period = i;
                    break;

                case ' ':
                case '\f':
                case '\n':
                case '\r':
                case '\t':
                    if (period >= 0) {
                        return i;
                    }
                    break;

                default:
                    period = -1;
                    break;
            }
        }
        return -1;
    }
18918
def word_break(s, word_dict):
    
    dp = [False] * (len(s)+1)
    dp[0] = True
    for i in range(1, len(s)+1):
        for j in range(0, i):
            if dp[j] and s[j:i] in word_dict:
                dp[i] = True
                break
    return dp[-1]
1160792
def read_clusters(self, min_cluster_size):
        """"""
        num_found = 0
        clusters = []
        with open(self.get_path(OslomRunner.OUTPUT_FILE), "r") as reader:
            # Read the output file every two lines
            for line1, line2 in itertools.izip_longest(*[reader] * 2):
                info = OslomRunner.RE_INFOLINE.match(line1.strip()).groups()
                nodes = line2.strip().split(" ")
                if len(nodes) >= min_cluster_size: # Apply min_cluster_size
                    clusters.append({
                        "id": int(info[0]),
                        "bs": float(info[2]),
                        "nodes": [{"id": self.id_remapper.get_str_id(int(n))} for n in nodes],
                    })
                num_found += 1
        return {"num_found": num_found, "clusters": clusters}
453904
def get_subgraphs(graph=None):
    
    graph = graph or DEPENDENCIES
    keys = set(graph)
    frontier = set()
    seen = set()
    while keys:
        frontier.add(keys.pop())
        while frontier:
            component = frontier.pop()
            seen.add(component)
            frontier |= set([d for d in get_dependencies(component) if d in graph])
            frontier |= set([d for d in get_dependents(component) if d in graph])
            frontier -= seen
        yield dict((s, get_dependencies(s)) for s in seen)
        keys -= seen
        seen.clear()
565976
def countContigClusters(clus)
      cur = clus; nxt = 0
      loop do
        nxt = getFatEntry(cur)
        break if nxt != cur + 1
        cur = nxt; redo
      end
      raise "Damaged cluster in cluster chain" if nxt == CC_DAMAGED
      cur - clus + 1
    end
776806
def reference(self, t, i, in_group=False):
        """"""

        current = []

        if not in_group and t == "m":
            current.append(self._re_start_wb)
        elif not in_group and t == "M":
            current.append(self._re_end_wb)
        elif not in_group and t == "R":
            current.append(self._re_line_break)
        elif not in_group and t == "X":
            no_mark = self.unicode_props("^m", None, in_group=False)[0]
            mark = self.unicode_props("m", None, in_group=False)[0]
            current.extend(self._grapheme_cluster % (no_mark, mark, mark))
        elif t == "e":
            current.append(self._re_escape)
        elif t == "l":
            current.extend(self.letter_case_props(_LOWER, in_group))
            self.found_property = True
        elif t == "L":
            current.extend(self.letter_case_props(_LOWER, in_group, negate=True))
            self.found_property = True
        elif t == "c":
            current.extend(self.letter_case_props(_UPPER, in_group))
            self.found_property = True
        elif t == "C":
            current.extend(self.letter_case_props(_UPPER, in_group, negate=True))
            self.found_property = True
        elif t == 'p':
            prop = self.get_unicode_property(i)
            current.extend(self.unicode_props(prop[0], prop[1], in_group=in_group))
            if in_group:
                self.found_property = True
        elif t == 'P':
            prop = self.get_unicode_property(i)
            current.extend(self.unicode_props(prop[0], prop[1], in_group=in_group, negate=True))
            if in_group:
                self.found_property = True
        elif t == "N":
            text = self.get_named_unicode(i)
            current.extend(self.unicode_name(text, in_group))
            if in_group:
                self.found_named_unicode = True
        else:
            current.extend(["\\", t])
        return current
34240
def _to_graph(self, contexts):
        """"""
        prev = None

        for context in contexts:
            if prev is None:
                prev = context
                continue

            yield prev[0], context[1], context[0]
            prev = context
852027
def GetChunk(time, breakpoints, b, mask=[]):
    '''
    

    '''

    M = np.delete(np.arange(len(time)), mask, axis=0)
    if b > 0:
        res = M[(M > breakpoints[b - 1]) & (M <= breakpoints[b])]
    else:
        res = M[M <= breakpoints[b]]
    return res
279903
public static int nvgraphSpectralClustering(
        nvgraphHandle handle, 
        nvgraphGraphDescr graph_descr, 
        long weight_index, 
        SpectralClusteringParameter params, 
        Pointer clustering, 
        Pointer eig_vals, 
        Pointer eig_vects)
    {
        return checkResult(nvgraphSpectralClusteringNative(handle, graph_descr, weight_index, params, clustering, eig_vals, eig_vects));
    }
654150
def get_cluster(self, word):
        
        idx = self.ix(word)
        return self.clusters[idx]
198474
def getIndices(self):
        """"""
        for indexName in self.neograph.nodes.indexes.keys():
            indexObject = self.neograph.nodes.indexes.get(indexName)
            yield Index(indexName, "vertex", "manual", indexObject)
        for indexName in self.neograph.relationships.indexes.keys():
            indexObject = self.neograph.relationships.indexes.get(indexName)
            yield Index(indexName, "edge", "manual", indexObject)
603706
def soft_break(self, el, text):
        """"""

        # Break word documents by paragraphs.
        if self.type == 'docx' and el.namespace == self.namespaces['w'] and el.name == 'p':
            text.append('\n')
        # Break slides by paragraphs.
        if self.type == 'pptx' and el.namespace == self.namespaces['a'] and el.name == 'p':
            text.append('\n')
1279285
public <E extends WeightedEdge> MultiMap<Integer,Integer> cluster(
              final WeightedGraph<E> graph, int numClusters, Properties props) {
        if (props.getProperty(KEEP_WEIGHT_VECTORS_PROPERTY) != null)
            keepWeightVectors = Boolean.parseBoolean(
                props.getProperty(KEEP_WEIGHT_VECTORS_PROPERTY));
        vertexToWeightVector.clear();
        return super.cluster(graph, numClusters, props);
    }
560243
function (posAry, limit, breakOneUp) {
  var numSections = posAry.length;
  var position = Math.ceil(limit / numSections);

  return posAry.map(function (seedAry) {
    var unchosen = position;
    // need a match in this section if no clear position-placer
    for (var i = 0; unchosen > 0; i += 1) {
      var xps = seedAry[i];
      var needForBetween = xps.length >1 && xps.length === unchosen && breakOneUp;
      if (xps.length > unchosen || needForBetween) {
        return xps.slice();
      }
      unchosen -= xps.length; // next cluster must be smaller to fit
    }
    return []; // nothing to break this section
  });
}