Description:
            Adjacent breaking
        Paramters:
            k: not used
320606
def _adj(self, k):
        
        G = np.zeros((self.m, self.m))
        for i in range(self.m):
            for j in range(self.m):
                if i == j+1 or j == i+1:
                    G[i][j] =  1
        return G
1280110
static void parenthesesToKaf(String parOut, KAFDocument kaf) throws Exception {
	String[] tokens = Tree.tokenize(parOut);
	Tree.check(tokens);
        HashMap<Integer, Integer> parMatching = Tree.matchParentheses(tokens);
	HashMap<Integer, Term> termMatching = Tree.matchTerms(tokens, kaf.getTerms());
	// behin-behineko irtenbidea errorea ekiditeko: hutsa itzuli
	if (termMatching.size() == 0) {
	    return;
	}
	List<Tree> trees = new ArrayList<Tree>();
	int current = 0;
	while (current < tokens.length) {
	    int end = parMatching.get(current);
	    NonTerminal root = Tree.createNonTerminal(tokens, current+1, end-1, parMatching, termMatching, kaf);
	    kaf.newConstituent(root);
	    current = end + 1;
	}
    }
234374
@SuppressWarnings("unchecked")
    private void fixdownMin(int k) {
        int c = 2 * k;
        while (c <= size) {
            int m = minChildOrGrandchild(k);
            if (m > c + 1) { // grandchild
                if (((Comparable<? super K>) array[m]).compareTo(array[k]) >= 0) {
                    break;
                }
                K tmp = array[k];
                array[k] = array[m];
                array[m] = tmp;
                if (((Comparable<? super K>) array[m]).compareTo(array[m / 2]) > 0) {
                    tmp = array[m];
                    array[m] = array[m / 2];
                    array[m / 2] = tmp;
                }
                // go down
                k = m;
                c = 2 * k;
            } else { // child
                if (((Comparable<? super K>) array[m]).compareTo(array[k]) < 0) {
                    K tmp = array[k];
                    array[k] = array[m];
                    array[m] = tmp;
                }
                break;
            }
        }
    }
1341151
function checkForBreakAfter(node, messageId) {
            const openParen = sourceCode.getTokenAfter(node, astUtils.isNotClosingParenToken);
            const nodeExpressionEnd = sourceCode.getTokenBefore(openParen);

            if (openParen.loc.start.line !== nodeExpressionEnd.loc.end.line) {
                context.report({ node, loc: openParen.loc.start, messageId, data: { char: openParen.value } });
            }
        }
254256
def param_union(*parameterizeds, **kwargs):
    
    warn = kwargs.pop('warn', True)
    if len(kwargs):
        raise TypeError(
            "param_union() got an unexpected keyword argument '{}'".format(
                kwargs.popitem()[0]))
    d = dict()
    for o in parameterizeds:
        for k in o.param:
            if k != 'name':
                if k in d and warn:
                    get_logger().warning("overwriting parameter {}".format(k))
                d[k] = getattr(o, k)
    return d
815248
def in_adjacent(filter=nil, &block)
      r = self.collect {|v| v.in_adjacent(filter, &block) }
      VertexSet.new(r).flatten.uniq
    end
1204493
def free_params(self):
        
        p = CombinedBounds(self.k.free_params, self.noise_k.free_params)
        if self.mu is not None:
            p = CombinedBounds(p, self.mu.free_params)
        return p
612001
private boolean isBreakBoundary(int index) {
        BreakIterator breakiterator = search_.breakIter();

        if (breakiterator == null) {
            breakiterator = search_.internalBreakIter_;
        }

        return (breakiterator != null && breakiterator.isBoundary(index));
    }
184908
public static <C extends Compound> List<SequenceView<C>> nonOverlappingKmers(Sequence<C> sequence, int kmer) {
		List<SequenceView<C>> l = new ArrayList<SequenceView<C>>();
		WindowedSequence<C> w = new WindowedSequence<C>(sequence, kmer);
		for(SequenceView<C> view: w) {
			l.add(view);
		}
		return l;
	}
107372
def p_break_statement_2(self, p):
        
        p[0] = self.asttypes.Break(p[2])
        p[0].setpos(p)
929621
def crack_k_from_sigs(generator, sig1, val1, sig2, val2):
    

    # s1 = v1 / k1 + (se * r1) / k1
    # s2 = v2 / k2 + (se * r2) / k2
    # and k = k1 = k2
    # so
    # k * s1 = v1 + (se * r1)
    # k * s2 = v2 + (se * r2)
    # so
    # k * s1 * r2 = r2 * v1 + (se * r1 * r2)
    # k * s2 * r1 = r1 * v2 + (se * r2 * r1)
    # so
    # k (s1 * r2 - s2 * r1) = r2 * v1 - r1 * v2
    # so
    # k = (r2 * v1 - r1 * v2) / (s1 * r2 - s2 * r1)

    r1, s1 = sig1
    r2, s2 = sig2
    if r1 != r2:
        raise ValueError("r values of signature do not match")
    k = (r2 * val1 - r1 * val2) * generator.inverse(r2 * s1 - r1 * s2)
    return k % generator.order()
1205218
public static Parser<Token> adjacent(Parser<List<Token>> parser, final Parser<?> otherwise) {
    return parser.next(tokens -> {
        if (tokens.isEmpty()) return Parsers.always();
        int offset = tokens.get(0).index();
        for (Token token : tokens) {
          if (token.index() != offset) {
            return otherwise;
          }
          offset += token.length();
        }
        return Parsers.always();
      }).atomic().source().token();
  }
48608
def _backward_slice_indirect(self, cfgnode, sim_successors, current_function_addr):
        
        # TODO: make this a real indirect jump resolver under the new paradigm

        irsb = sim_successors.artifacts['irsb']  # shorthand

        l.debug("Resolving indirect jump at IRSB %s", irsb)

        # Let's slice backwards from the end of this exit
        next_tmp = irsb.next.tmp
        stmt_id = [i for i, s in enumerate(irsb.statements)
                   if isinstance(s, pyvex.IRStmt.WrTmp) and s.tmp == next_tmp][0]

        cdg = self.project.analyses.CDG(cfg=self, fail_fast=self._fail_fast)
        ddg = self.project.analyses.DDG(cfg=self, start=current_function_addr, call_depth=0, fail_fast=self._fail_fast)

        bc = self.project.analyses.BackwardSlice(self,
                                                 cdg,
                                                 ddg,
                                                 targets=[(cfgnode, stmt_id)],
                                                 same_function=True,
                                                 fail_fast=self._fail_fast)
        taint_graph = bc.taint_graph
        # Find the correct taint
        next_nodes = [cl for cl in taint_graph.nodes() if cl.block_addr == sim_successors.addr]

        if not next_nodes:
            l.error('The target exit is not included in the slice. Something is wrong')
            return []

        next_node = next_nodes[0]

        # Get the weakly-connected subgraph that contains `next_node`
        all_subgraphs = networkx.weakly_connected_component_subgraphs(taint_graph)
        starts = set()
        for subgraph in all_subgraphs:
            if next_node in subgraph:
                # Make sure there is no symbolic read...
                # FIXME: This is an over-approximation. We should try to limit the starts more
                nodes = [n for n in subgraph.nodes() if subgraph.in_degree(n) == 0]
                for n in nodes:
                    starts.add(n.block_addr)

        # Execute the slice
        successing_addresses = set()
        annotated_cfg = bc.annotated_cfg()
        for start in starts:
            l.debug('Start symbolic execution at 0x%x on program slice.', start)
            # Get the state from our CFG
            node = self.get_any_node(start)
            if node is None:
                # Well, we have to live with an empty state
                base_state = self.project.factory.blank_state(addr=start)
            else:
                base_state = node.input_state.copy()
                base_state.set_mode('symbolic')
                base_state.ip = start

                # Clear all initial taints (register values, memory values, etc.)
                initial_nodes = [n for n in bc.taint_graph.nodes() if bc.taint_graph.in_degree(n) == 0]
                for cl in initial_nodes:
                    # Iterate in all actions of this node, and pick corresponding actions
                    cfg_nodes = self.get_all_nodes(cl.block_addr)
                    for n in cfg_nodes:
                        if not n.final_states:
                            continue
                        actions = [ac for ac in n.final_states[0].history.recent_actions
                                   # Normally it's enough to only use the first final state
                                   if ac.bbl_addr == cl.block_addr and
                                   ac.stmt_idx == cl.stmt_idx
                                   ]
                        for ac in actions:
                            if not hasattr(ac, 'action'):
                                continue
                            if ac.action == 'read':
                                if ac.type == 'mem':
                                    unconstrained_value = base_state.solver.Unconstrained('unconstrained',
                                                                                      ac.size.ast * 8)
                                    base_state.memory.store(ac.addr,
                                                            unconstrained_value,
                                                            endness=self.project.arch.memory_endness)
                                elif ac.type == 'reg':
                                    unconstrained_value = base_state.solver.Unconstrained('unconstrained',
                                                                                      ac.size.ast * 8)
                                    base_state.registers.store(ac.offset,
                                                               unconstrained_value,
                                                               endness=self.project.arch.register_endness)

                # Clear the constraints!
                base_state.release_plugin('solver')

            # For speed concerns, we are limiting the timeout for z3 solver to 5 seconds
            base_state.solver._solver.timeout = 5000

            sc = self.project.factory.simulation_manager(base_state)
            sc.use_technique(Slicecutor(annotated_cfg))
            sc.use_technique(LoopSeer(bound=1))
            sc.run()

            if sc.cut or sc.deadended:
                all_deadended_states = sc.cut + sc.deadended
                for s in all_deadended_states:
                    if s.addr == sim_successors.addr:
                        # We want to get its successors
                        succs = s.step()
                        for succ in succs.flat_successors:
                            successing_addresses.add(succ.addr)

            else:
                l.debug("Cannot determine the exit. You need some better ways to recover the exits :-(")

        l.debug('Resolution is done, and we have %d new successors.', len(successing_addresses))

        return list(successing_addresses)
594461
def visit_break(self, node, parent):
        """"""
        return nodes.Break(
            getattr(node, "lineno", None), getattr(node, "col_offset", None), parent
        )
382157
private void forceDecreaseKeyToMinimum(Node<K, V> n) {
        // if not root
        Node<K, V> y = n.parent;
        if (y != null) {
            cut(n, y);
            cascadingCut(y);
        }
        minRoot = n;
    }
1128063
public synchronized void setIfNotSet(String k, String v) {
        if (findValue(k) == null) {
            add(k, v);
        }
    }
387265
def skip(self, other):
        ''''''
        @Parser
        def ends_with_parser(text, index):
            res = self(text, index)
            if not res.status:
                return res
            end = other(text, res.index)
            if end.status:
                return Value.success(end.index, res.value)
            else:
                return Value.failure(end.index, 'ends with {}'.format(end.expected))
        return ends_with_parser