Given a the denominator of a division node, returns all the nested denominator nodess. e.g. 2/3/4/5 would return [2,3,4,5] (note: all the numbers in the example are actually constant nodes)
511421
function getDenominatorList(denominator) {
  let node = denominator;
  const denominatorList = [];
  while (node.op === '/') {
    // unshift the denominator to the front of the list, and recurse on
    // the numerator
    denominatorList.unshift(node.args[1]);
    node = node.args[0];
  }
  // unshift the final node, which wasn't a / node
  denominatorList.unshift(node);
  return denominatorList;
}
1325643
def _parse_edge_weight(f, nodes):
    
    matrix = []

    n = 0

    for line in f:
        line = strip(line)

        regex = re.compile(r'\s+')

        row = regex.split(line)

        matrix.append(row)

        n = n + 1

        if n == nodes:
            break

    if n != nodes:
        raise ParseException('Missing {} nodes definition from section EDGE_WEIGHT_SECTION'.format(nodes - n))

    return matrix
630408
def nodes(self, alias, depth=10, bank_id=None):
        
        if bank_id:
            return self._root + self._safe_alias(alias) + '/child/nodes/' + bank_id + '?descendentlevels=' + str(depth)
        else:
            return self._root + self._safe_alias(alias) + '/root/nodes?descendentlevels=' + str(depth)
1041566
def parse(node)
      node.xpath('*').each do |node_child|
        case node_child.name
        when 'r'
          @formula_run << MathRun.new(parent: self).parse(node_child)
        when 'box', 'borderBox'
          @formula_run << Box.new(parent: self).parse(node_child)
        when 'func'
          @formula_run << Function.new(parent: self).parse(node_child)
        when 'rad'
          @formula_run << Radical.new(parent: self).parse(node_child)
        when 'e', 'eqArr'
          @formula_run << DocxFormula.new(parent: self).parse(node_child)
        when 'nary'
          @formula_run << Nary.new(parent: self).parse(node_child)
        when 'd'
          @formula_run << Delimiter.new(parent: self).parse(node_child)
        when 'sSubSup', 'sSup', 'sSub'
          @formula_run << Index.new(parent: self).parse(node_child)
        when 'f'
          @formula_run << Fraction.new(parent: self).parse(node_child)
        when 'm'
          @formula_run << Matrix.new(parent: self).parse(node_child)
        when 'bar'
          @formula_run << Bar.new(parent: self).parse(node_child)
        when 'acc'
          @formula_run << Accent.new(parent: self).parse(node_child)
        when 'groupChr'
          @formula_run << GroupChar.new(parent: self).parse(node_child)
        when 'argPr'
          @argument_properties = ArgumentProperties.new(parent: self).parse(node_child)
        when 'sPre'
          @formula_run << PreSubSuperscript.new(parent: self).parse(node_child)
        when 'limUpp', 'limLow'
          @formula_run << Limit.new(parent: self).parse(node_child)
        end
      end
      return nil if @formula_run.empty?

      self
    end
1060035
private function exprList() {
    $node = new CommaListNode();
    do {
      $node->addChild($this->expr());
    } while ($this->tryMatch(',', $node));
    return $node;
  }
566847
def subdivide(self):
        
        left_nodes, right_nodes = _curve_helpers.subdivide_nodes(self.nodes)
        midpoint = 0.5 * (self.start + self.end)
        left = SubdividedCurve(
            left_nodes, self.original_nodes, start=self.start, end=midpoint
        )
        right = SubdividedCurve(
            right_nodes, self.original_nodes, start=midpoint, end=self.end
        )
        return left, right
422285
function multiplyFractions(node) {
  if (!Node.Type.isOperator(node) || node.op !== '*') {
    return Node.Status.noChange(node);
  }
  const atLeastOneFraction = node.args.some(
    arg => Node.Type.isOperator(arg, '/'));
  const hasPolynomialTerms = node.args.some(
    arg => Node.PolynomialTerm.isPolynomialTerm(arg));
  if (!atLeastOneFraction || hasPolynomialTerms) {
    return Node.Status.noChange(node);
  }

  const numeratorArgs = [];
  const denominatorArgs = [];
  node.args.forEach(operand => {
    if (Node.Type.isOperator(operand, '/')) {
      numeratorArgs.push(operand.args[0]);
      denominatorArgs.push(operand.args[1]);
    }
    else {
      numeratorArgs.push(operand);
    }
  });

  const newNumerator = Node.Creator.parenthesis(
    Node.Creator.operator('*', numeratorArgs));
  const newDenominator = denominatorArgs.length === 1
    ? denominatorArgs[0]
    : Node.Creator.parenthesis(Node.Creator.operator('*', denominatorArgs));

  const newNode = Node.Creator.operator('/', [newNumerator, newDenominator]);
  return Node.Status.nodeChanged(
    ChangeTypes.MULTIPLY_FRACTIONS, node, newNode);
}
1119772
private function collectSelfConstants()
    {
        $expressionSolver = new NodeExpressionResolver($this);
        $localConstants   = [];

        // constants can be only top-level nodes in the class, so we can scan them directly
        foreach ($this->classLikeNode->stmts as $classLevelNode) {
            if ($classLevelNode instanceof ClassConst) {
                $nodeConstants = $classLevelNode->consts;
                if (!empty($nodeConstants)) {
                    foreach ($nodeConstants as $nodeConstant) {
                        $expressionSolver->process($nodeConstant->value);
                        $localConstants[$nodeConstant->name->toString()] = $expressionSolver->getValue();
                        $this->constants = $localConstants + $this->constants;
                    }
                }
            }
        }
    }
930848
def nodes(self):
        
        nodes = np.array(list(self.transforms.nodes()))
        return nodes
1374337
function combineNumeratorsAboveCommonDenominator(node) {
  let newNode = clone(node);

  const commonDenominator = newNode.args[0].args[1];
  const numeratorArgs = [];
  newNode.args.forEach(fraction => {
    numeratorArgs.push(fraction.args[0]);
  });
  const newNumerator = Node.Creator.parenthesis(
    Node.Creator.operator('+', numeratorArgs));

  newNode = Node.Creator.operator('/', [newNumerator, commonDenominator]);
  return Node.Status.nodeChanged(
    ChangeTypes.COMBINE_NUMERATORS, node, newNode);
}
1242570
def get_nodes_positions(self):
        
        nodes = self.get_nodes()
        output = {}
        for node in nodes:
            output[node[0]] = (float(node[1][consts.Consts.x]), float(node[1][consts.Consts.y]))
        return output
281977
def nodes_touching_edge(edge_coord):
    
    a, b = hex_digit(edge_coord, 1), hex_digit(edge_coord, 2)
    if a % 2 == 0 and b % 2 == 0:
        return [coord_from_hex_digits(a, b + 1),
                coord_from_hex_digits(a + 1, b)]
    else:
        return [coord_from_hex_digits(a, b),
                coord_from_hex_digits(a + 1, b + 1)]
46416
def match(self, node):
        
        """
        if node.type == self.syms.term:
            div_idx = find_division(node)
            if div_idx is not False:
                # if expr1 or expr2 are obviously floats, we don't need to wrap in
                # old_div, as the behavior of division between any number and a float
                # should be the same in 2 or 3
                if not is_floaty(node, div_idx):
                    return clone_div_operands(node, div_idx)
        return False
404874
function getTermsForCollectingAddition(node) {
  let terms = {};

  for(let i = 0; i < node.args.length; i++) {
    const child = node.args[i];

    if (Node.PolynomialTerm.isPolynomialTerm(child)) {
      const termName = getTermName(child, '+');
      terms = Util.appendToArrayInObject(terms, termName, child);
    }
    else if (Node.Type.isIntegerFraction(child)) {
      terms = Util.appendToArrayInObject(terms, CONSTANT_FRACTION, child);
    }
    else if (Node.Type.isConstant(child)) {
      terms = Util.appendToArrayInObject(terms, CONSTANT, child);
    }
    else if (Node.Type.isOperator(node) ||
             Node.Type.isFunction(node) ||
             Node.Type.isParenthesis(node) ||
             Node.Type.isUnaryMinus(node)) {
      terms = Util.appendToArrayInObject(terms, OTHER, child);
    }
    else {
      // Note that we shouldn't get any symbol nodes in the switch statement
      // since they would have been handled by isPolynomialTerm
      throw Error('Unsupported node type: ' + child.type);
    }
  }
  // If there's exactly one constant and one fraction, we collect them
  // to add them together.
  // e.g. 2 + 1/3 + 5 would collect the constants (2+5) + 1/3
  // but 2 + 1/3 + x would collect (2 + 1/3) + x so we can add them together
  if (terms[CONSTANT] && terms[CONSTANT].length === 1 &&
     terms[CONSTANT_FRACTION] && terms[CONSTANT_FRACTION].length === 1) {
    const fraction = terms[CONSTANT_FRACTION][0];
    terms = Util.appendToArrayInObject(terms, CONSTANT, fraction);
    delete terms[CONSTANT_FRACTION];
  }

  return terms;
}
180108
public void findAllCC() {
		if (nodeCC == null) {
			CCFirstNode = new int[n];
			CCNextNode = new int[n];
			nodeCC = new int[n];
			sizeCC = new int[n];
		}
		sizeMinCC = 0;
		sizeMaxCC = 0;
		ISet act = graph.getNodes();
		for (int i : act) {
			p[i] = -1;
		}
		for (int i = 0; i < CCFirstNode.length; i++) {
			CCFirstNode[i] = -1;
			sizeCC[i] = -1;
		}
		int cc = 0;
		for (int i : act) {
			if (p[i] == -1) {
				findCC(i, cc);
				if (sizeMinCC == 0 || sizeMinCC > sizeCC[cc]) {
					sizeMinCC = sizeCC[cc];
				}
				if (sizeMaxCC < sizeCC[cc]) {
					sizeMaxCC = sizeCC[cc];
				}
				cc++;
			}
		}
		nbCC = cc;
	}
248994
function findNodes(node, kind, max = Infinity) {
    if (!node || max == 0) {
        return [];
    }
    const arr = [];
    if (node.kind === kind) {
        arr.push(node);
        max--;
    }
    if (max > 0) {
        for (const child of node.getChildren()) {
            findNodes(child, kind, max).forEach(node => {
                if (max > 0) {
                    arr.push(node);
                }
                max--;
            });
            if (max <= 0) {
                break;
            }
        }
    }
    return arr;
}
734274
function flattenNodes(nodes) {
	return nodes.reduce((acc, item) => {
		if (item.nodes) acc.push(...flattenNodes(item.nodes))
		else acc.push(item);
		return acc;
	}, []);
}