Unnamed: 0 int64 0 305k | body stringlengths 7 52.9k | name stringlengths 1 185 |
|---|---|---|
273,900 | void (String message) { } | info |
273,901 | void (String message, Throwable t) { } | info |
273,902 | void (String message) { } | warn |
273,903 | void (String message, Throwable t) { } | warn |
273,904 | void (String message) { } | trace |
273,905 | boolean () { return false; } | isTraceEnabled |
273,906 | String () { return myPresentation; } | getName |
273,907 | String () { return myDescription; } | getDescription |
273,908 | PrintElement () { return myPrintElement; } | getAffectedElement |
273,909 | Type () { return myActionType; } | getType |
273,910 | String (GraphLayout graphLayout, int nodesCount) { StringBuilder s = new StringBuilder(); for (int nodeIndex = 0; nodeIndex < nodesCount; nodeIndex++) { if (nodeIndex != 0) s.append("\n"); s.append(graphLayout.getLayoutIndex(nodeIndex)).append(CommitParser.SEPARATOR).append(graphLayout.getOneOfHeadNodeIndex(nodeIndex)); } return s.toString(); } | permanentGraphLayoutModelToStr |
273,911 | String (ReachableNodes reachableNodes, Set<Integer> branches, int nodesCount) { StringBuilder s = new StringBuilder(); for (int nodeIndex = 0; nodeIndex < nodesCount; nodeIndex++) { if (nodeIndex != 0) s.append("\n"); List<Integer> branchNodeIndexes = new ArrayList<>(reachableNodes.getContainingBranches(nodeIndex, branches)); if (branchNodeIndexes.isEmpty()) { s.append("none"); continue; } Collections.sort(branchNodeIndexes); boolean first = true; for (int branchNodeIndex : branchNodeIndexes) { if (first) { first = false; } else { s.append(" "); } s.append(branchNodeIndex); } } return s.toString(); } | containingBranchesGetterToStr |
273,912 | String (@NotNull EdgesInRowGenerator edgesInRowGenerator, int nodesCount) { StringBuilder s = new StringBuilder(); for (int i = 0; i < nodesCount; i++) { if (i > 0) s.append("\n"); Set<GraphEdge> edgesInRow = edgesInRowGenerator.getEdgesInRow(i); s.append(edgesToStr(edgesInRow)); } return s.toString(); } | edgesInRowToStr |
273,913 | String (@NotNull Set<GraphEdge> edges) { if (edges.isEmpty()) return "none"; List<GraphEdge> sortedEdges = new ArrayList<>(edges); Collections.sort(sortedEdges, GRAPH_ELEMENT_COMPARATOR); return StringUtil.join(sortedEdges, graphEdge -> graphEdge.getUpNodeIndex() + "_" + graphEdge.getDownNodeIndex() + "_" + toChar(graphEdge.getType()), " "); } | edgesToStr |
273,914 | UpdatableIntToIntMap (@NotNull Predicate<? super Integer> thisIsVisible, int longSize) { return ListIntToIntMap.newInstance(new PredicateFlags(thisIsVisible, longSize), 3); } | createUpdatableIntToIntMap |
273,915 | TimestampGetter (final long... timestamp) { return new TimestampGetter() { @Override public int size() { return timestamp.length; } @Override public long getTimestamp(int index) { return timestamp[index]; } }; } | create |
273,916 | int () { return timestamp.length; } | size |
273,917 | long (int index) { return timestamp[index]; } | getTimestamp |
273,918 | String (@NotNull TimestampGetter timestampGetter) { StringBuilder s = new StringBuilder(); for (int i = 0; i < timestampGetter.size(); i++) { if (i != 0) s.append(", "); s.append(timestampGetter.getTimestamp(i)); } return s.toString(); } | toStr |
273,919 | void (long... timestamp) { TimestampGetter timestampGetter = create(timestamp); IntTimestampGetter intTimestampGetter = IntTimestampGetter.newInstance(timestampGetter, BLOCK_SIZE); assertEquals(toStr(timestampGetter), toStr(intTimestampGetter)); } | runTest |
273,920 | void () { runTest(1, 4, 2, -4, 200); } | simple |
273,921 | void () { try { runTest(); } catch (IllegalArgumentException e) { return; } fail(); } | checkEmpty |
273,922 | void () { runTest(1); runTest(1, 2); runTest(1, 2, 3); runTest(1, 2, 3, 4); runTest(1, 2, 3, 4, 5); runTest(1, 2, 3, 4, 5, 6); runTest(1, 2, 3, 4, 5, 6, 7); } | checkBlockSize |
273,923 | void () { runTest(1); runTest(-INT_MAX); runTest(INT_MAX); runTest(INT_MAX - 100); runTest(INT_MAX - 1000); } | oneTime |
273,924 | void () { runTest(1000, 1000 + INT_MAX, INT_MAX, -INT_MAX, 100 * INT_MAX); } | overflow |
273,925 | String (@NotNull IntList intList) { StringBuilder s = new StringBuilder(); for (int i = 0; i < intList.size(); i++) { if (i != 0) s.append(", "); s.append(intList.get(i)); } return s.toString(); } | toStr |
273,926 | IntList (final int... list) { return new IntList() { @Override public int size() { return list.length; } @Override public int get(int index) { return list[index]; } }; } | toDataList |
273,927 | int () { return list.length; } | size |
273,928 | int (int index) { return list[index]; } | get |
273,929 | void (int... list) { IntList intList = CompressedIntList.newInstance(list, 3); String expected = toStr(toDataList(list)); assertEquals(expected, toStr(intList)); } | runTest |
273,930 | void () { runTest(); } | empty |
273,931 | void () { runTest(0); runTest(BYTE_MAX); runTest(BYTE2_MAX); runTest(BYTE3_MAX); } | oneValue |
273,932 | void () { runTest(0, BYTE_MAX); runTest(-10, BYTE_MAX); runTest(-BYTE_MAX, BYTE_MAX); runTest(0, -BYTE_MAX); runTest(0, -BYTE2_MAX); runTest(0, -BYTE3_MAX); runTest(0, -2 * BYTE3_MAX); runTest(0, -2 * BYTE2_MAX); runTest(0, -2 * BYTE_MAX); runTest(0, BYTE_MAX); runTest(0, BYTE2_MAX); runTest(0, BYTE3_MAX); runTest(0, 2 * BYTE3_MAX); runTest(0, 2 * BYTE2_MAX); runTest(0, 2 * BYTE_MAX); } | twoValueWithBigDelta |
273,933 | void () { runTest(BYTE_MAX, 0, BYTE_MAX); runTest(BYTE_MAX, -10, BYTE_MAX); runTest(BYTE_MAX, -BYTE_MAX, BYTE_MAX); runTest(-BYTE_MAX, 0, -BYTE_MAX); runTest(-BYTE2_MAX, 0, -BYTE2_MAX); runTest(-BYTE3_MAX, 0, -BYTE3_MAX); runTest(-2 * BYTE3_MAX, 0, -2 * BYTE3_MAX); runTest(-2 * BYTE2_MAX, 0, -2 * BYTE2_MAX); runTest(-2 * BYTE_MAX, 0, -2 * BYTE_MAX); runTest(BYTE_MAX, 0, BYTE_MAX); runTest(BYTE2_MAX, 0, BYTE2_MAX); runTest(BYTE3_MAX, 0, BYTE3_MAX); runTest(2 * BYTE3_MAX, 0, 2 * BYTE3_MAX); runTest(2 * BYTE2_MAX, 0, 2 * BYTE2_MAX); runTest(2 * BYTE_MAX, 0, 2 * BYTE_MAX); } | treeValueWithBigDelta |
273,934 | void () { runTest(0, 1, -1, BYTE3_MAX, BYTE3_MAX, BYTE3_MAX, -BYTE3_MAX); } | more |
273,935 | void () { runTest(0, INT_MAX, -INT_MAX, INT_MAX, BYTE3_MAX, 0, -INT_MAX, 0, -INT_MAX, INT_MAX, 0); } | bigNumbers |
273,936 | void () { runTest(1); runTest(1, 2); runTest(1, 2, 3); runTest(1, 2, 3, 4); runTest(1, 2, 3, 4, 5); runTest(1, 2, 3, 4, 5, 6); runTest(1, 2, 3, 4, 5, 6, 7); runTest(1, 2, 3, 4, 5, 6, 7, 8); } | checkBlockSize |
273,937 | String (@NotNull UnsignedBitSet bitSet) { StringBuilder s = new StringBuilder(); for (int i = -5; i <= 5; i++) { if (bitSet.get(i)) { s.append(1); } else { s.append(0); } } return s.toString(); } | toStr |
273,938 | void () { UnsignedBitSet bitSet = new UnsignedBitSet(); assertEquals("00000000000", toStr(bitSet)); } | initFalse |
273,939 | void () { UnsignedBitSet bitSet = new UnsignedBitSet(); bitSet.set(0, true); assertEquals("00000100000", toStr(bitSet)); } | setZero |
273,940 | void () { UnsignedBitSet bitSet = new UnsignedBitSet(); bitSet.set(1, true); assertEquals("00000010000", toStr(bitSet)); } | setOne |
273,941 | void () { UnsignedBitSet bitSet = new UnsignedBitSet(); bitSet.set(-1, true); assertEquals("00001000000", toStr(bitSet)); } | setMinusOne |
273,942 | void () { UnsignedBitSet bitSet = new UnsignedBitSet(); bitSet.set(3, true); bitSet.set(-3, true); bitSet.set(-2, true); assertEquals("00110000100", toStr(bitSet)); } | setSeveralTimes |
273,943 | void () { UnsignedBitSet bitSet = new UnsignedBitSet(); bitSet.set(0, 4, true); assertEquals("00000111110", toStr(bitSet)); } | setPositiveRange |
273,944 | void () { UnsignedBitSet bitSet = new UnsignedBitSet(); bitSet.set(-3, -1, true); assertEquals("00111000000", toStr(bitSet)); } | setNegativeRange |
273,945 | void () { UnsignedBitSet bitSet = new UnsignedBitSet(); bitSet.set(-3, 1, true); assertEquals("00111110000", toStr(bitSet)); } | setRange |
273,946 | UpdatableIntToIntMap (final @NotNull Predicate<? super Integer> thisIsVisible, final int longSize) { return new UpdatableIntToIntMapWrapper(new Flags() { @Override public int size() { return longSize; } @Override public boolean get(int index) { return thisIsVisible.test(index); } @Override public void set(int index, boolean value) { throw new UnsupportedOperationException(); } @Override public void setAll(boolean value) { throw new UnsupportedOperationException(); } }); } | createUpdatableIntToIntMap |
273,947 | int () { return longSize; } | size |
273,948 | boolean (int index) { return thisIsVisible.test(index); } | get |
273,949 | void (int index, boolean value) { throw new UnsupportedOperationException(); } | set |
273,950 | void (boolean value) { throw new UnsupportedOperationException(); } | setAll |
273,951 | void () { int shortSize = 0; for (int i = 0; i < myFlags.size(); i++) { if (myFlags.get(i)) shortSize++; } myIntToIntMap = PermanentListIntToIntMap.newInstance(myFlags, shortSize, 2); } | createIntToIntMap |
273,952 | void (int startLongIndex, int endLongIndex) { createIntToIntMap(); } | update |
273,953 | int () { return myIntToIntMap.shortSize(); } | shortSize |
273,954 | int () { return myIntToIntMap.longSize(); } | longSize |
273,955 | int (int shortIndex) { return myIntToIntMap.getLongIndex(shortIndex); } | getLongIndex |
273,956 | int (int longIndex) { return myIntToIntMap.getShortIndex(longIndex); } | getShortIndex |
273,957 | char (boolean bit) { return bit ? '1' : '0'; } | bitToChar |
273,958 | String (@NotNull Flags flags) { StringBuilder s = new StringBuilder(); for (int i = 0; i < flags.size(); i++) { s.append(bitToChar(flags.get(i))); } return s.toString(); } | toStr |
273,959 | void () { BitSetFlags flags = new BitSetFlags(5); assertEquals("00000", toStr(flags)); assertEquals(5, flags.size()); } | initTest |
273,960 | void () { BitSetFlags flags = new BitSetFlags(6); assertEquals("000000", toStr(flags)); flags.set(0, true); assertEquals("100000", toStr(flags)); flags.set(0, false); assertEquals("000000", toStr(flags)); flags.set(4, true); assertEquals("000010", toStr(flags)); flags.set(2, true); assertEquals("001010", toStr(flags)); } | setTest |
273,961 | void () { BitSetFlags flags = new BitSetFlags(6); assertEquals("000000", toStr(flags)); flags.setAll(false); assertEquals("000000", toStr(flags)); flags.setAll(true); assertEquals("111111", toStr(flags)); } | setAllTest |
273,962 | void () { BitSetFlags flags = new BitSetFlags(1); assertEquals("0", toStr(flags)); assertEquals(1, flags.size()); flags.set(0, true); assertEquals("1", toStr(flags)); flags.set(0, false); assertEquals("0", toStr(flags)); flags.setAll(true); assertEquals("1", toStr(flags)); } | size1Test |
273,963 | void () { BitSetFlags flags = new BitSetFlags(0); assertEquals(0, flags.size()); flags.setAll(true); assertEquals(0, flags.size()); } | emptyFlagsTest |
273,964 | UpdatableIntToIntMap (@NotNull Predicate<? super Integer> thisIsVisible, int longSize) { return TreeIntToIntMap.newInstance(thisIsVisible, longSize); } | createUpdatableIntToIntMap |
273,965 | Set<Integer> (String visibility) { Set<Integer> visibleNodes = new HashSet<>(); if (visibility.length() == 0) return visibleNodes; for (String number : visibility.split("\\|")) { visibleNodes.add(Integer.decode(number)); } return visibleNodes; } | parseSet |
273,966 | void (int updateFrom, int updateTo, String newVisibility) { myVisibleNodes.clear(); myVisibleNodes.addAll(parseSet(newVisibility)); myUpdatableIntToIntMap.update(updateFrom, updateTo); assertEquals(newVisibility, mapToString()); } | changeVisibility |
273,967 | String () { StringBuilder s = new StringBuilder(); for (int shortIndex = 0; shortIndex < myUpdatableIntToIntMap.shortSize(); shortIndex++) { if (shortIndex != 0) s.append("|"); s.append(myUpdatableIntToIntMap.getLongIndex(shortIndex)); } return s.toString(); } | mapToString |
273,968 | String () { StringBuilder s = new StringBuilder(); for (int longIndex = 0; longIndex < myUpdatableIntToIntMap.longSize(); longIndex++) { if (longIndex != 0) s.append("|"); s.append(myUpdatableIntToIntMap.getShortIndex(longIndex)); } return s.toString(); } | reverseMapToString |
273,969 | void (String expected) { assertEquals(expected, reverseMapToString()); } | testLongToShort |
273,970 | Tester (int longSize, String initVisibility) { final Set<Integer> visibleNodes = parseSet(initVisibility); UpdatableIntToIntMap updatableIntToIntMap = createUpdatableIntToIntMap(integer -> visibleNodes.contains(integer), longSize); Tester tester = new Tester(updatableIntToIntMap, visibleNodes); assertEquals(initVisibility, tester.mapToString()); return tester; } | getTest |
273,971 | void () { Tester tester = getTest(6, "0|1|2|3|4|5"); tester.changeVisibility(1, 3, "0|2|4|5"); tester.changeVisibility(2, 2, "0|4|5"); tester.changeVisibility(1, 1, "0|1|4|5"); } | simpleTest |
273,972 | void () { Tester tester = getTest(1, "0"); tester.changeVisibility(0, 0, ""); tester.changeVisibility(0, 0, ""); tester.changeVisibility(0, 0, "0"); tester.changeVisibility(0, 0, "0"); tester.changeVisibility(0, 0, ""); } | testOneNode |
273,973 | void () { Tester tester = getTest(2, "0"); tester.changeVisibility(1, 1, "0|1"); tester.changeVisibility(0, 1, ""); tester.changeVisibility(0, 0, "0"); } | testTwoNodes |
273,974 | void () { Tester tester = getTest(4, "2|3"); tester.changeVisibility(1, 3, "1"); tester.changeVisibility(0, 2, "0|1|2"); tester.changeVisibility(0, 0, "1|2"); } | test4Nodes |
273,975 | void () { Tester tester = getTest(5, "0|1|2|3|4"); tester.changeVisibility(4, 4, "0|1|2|3"); tester.changeVisibility(3, 4, "0|1|2|4"); } | test5Nodes |
273,976 | void () { Tester tester = getTest(7, "0|1|2|3|4|5|6"); tester.testLongToShort("0|1|2|3|4|5|6"); tester.changeVisibility(2, 4, "0|1|5|6"); tester.testLongToShort("0|1|1|1|1|2|3"); } | testReverseMap |
273,977 | void () { Tester tester = getTest(8, "0|4|7"); tester.testLongToShort("0|0|0|0|1|1|1|2"); tester.changeVisibility(0, 0, "4|7"); tester.testLongToShort("0|0|0|0|0|0|0|1"); } | testReverseMap2 |
273,978 | void () { Tester tester = getTest(1, ""); tester.testLongToShort("0"); tester.changeVisibility(0, 0, "0"); tester.testLongToShort("0"); } | testReverseWithMinNodes |
273,979 | void () { Tester tester = getTest(2, ""); tester.testLongToShort("0|0"); tester.changeVisibility(1, 1, "1"); tester.testLongToShort("0|0"); tester.changeVisibility(0, 0, "0|1"); tester.testLongToShort("0|1"); } | testReverseWithMinNodes2 |
273,980 | void () { Tester tester = getTest(0, ""); tester.testLongToShort(""); } | emptyTest |
273,981 | void () { getTest(0, "").testLongToShort(""); getTest(1, "0").testLongToShort("0"); getTest(2, "0|1").testLongToShort("0|1"); getTest(3, "0|1|2").testLongToShort("0|1|2"); getTest(4, "0|1|2|3").testLongToShort("0|1|2|3"); getTest(5, "0|1|2|3|4").testLongToShort("0|1|2|3|4"); getTest(6, "0|1|2|3|4|5").testLongToShort("0|1|2|3|4|5"); getTest(7, "0|1|2|3|4|5|6").testLongToShort("0|1|2|3|4|5|6"); } | blockSizeTest |
273,982 | LinearGraph (@NotNull String in) { List<GraphNode> graphNodes = new ArrayList<>(); Map<GraphNode, List<String>> edges = new HashMap<>(); Int2IntMap nodeIdToNodeIndex = new Int2IntOpenHashMap(); for (String line : toLines(in)) { // parse input and create nodes ParsedLine graphNodePair = parseLine(line, graphNodes.size()); edges.put(graphNodePair.graphNode, graphNodePair.normalEdges); nodeIdToNodeIndex.put(graphNodePair.nodeId, graphNodes.size()); graphNodes.add(graphNodePair.graphNode); } MultiMap<Integer, GraphEdge> upEdges = MultiMap.create(); MultiMap<Integer, GraphEdge> downEdges = MultiMap.create(); for (GraphNode graphNode : graphNodes) { // create edges for (String strEdge : edges.get(graphNode)) { NumberWithChar pairEdge = parseNumberWithChar(strEdge); GraphEdgeType type = parseGraphEdgeType(pairEdge.character); GraphEdge edge; switch (type) { case USUAL, DOTTED -> { assert nodeIdToNodeIndex.containsKey(pairEdge.nodeId); int downNodeIndex = nodeIdToNodeIndex.get(pairEdge.nodeId); edge = GraphEdge.createNormalEdge(graphNode.getNodeIndex(), downNodeIndex, type); } case NOT_LOAD_COMMIT, DOTTED_ARROW_DOWN, DOTTED_ARROW_UP -> edge = GraphEdge.createEdgeWithTargetId(graphNode.getNodeIndex(), pairEdge.nodeId, type); default -> throw new IllegalStateException("Unknown type: " + type); } if (edge.getUpNodeIndex() != null) downEdges.putValue(edge.getUpNodeIndex(), edge); if (edge.getDownNodeIndex() != null) upEdges.putValue(edge.getDownNodeIndex(), edge); } } return new TestLinearGraphWithElementsInfo(graphNodes, upEdges, downEdges); } | parse |
273,983 | ParsedLine (@NotNull String line, int lineNumber) { int separatorIndex = nextSeparatorIndex(line, 0); NumberWithChar pair = parseNumberWithChar(line.substring(0, separatorIndex)); GraphNode graphNode = new GraphNode(lineNumber, parseGraphNodeType(pair.character)); String[] edges = line.substring(separatorIndex + 2).split("\\s"); List<String> normalEdges = ContainerUtil.mapNotNull(edges, s -> { if (s.isEmpty()) return null; return s; }); return new ParsedLine(pair.nodeId, graphNode, normalEdges); } | parseLine |
273,984 | NumberWithChar (@NotNull String in) { return new NumberWithChar(Integer.decode(in.substring(0, in.length() - 2)), in.charAt(in.length() - 1)); } | parseNumberWithChar |
273,985 | int () { return myGraphNodes.size(); } | nodesCount |
273,986 | List<GraphEdge> (int nodeIndex, @NotNull EdgeFilter filter) { List<GraphEdge> result = new ArrayList<>(); for (GraphEdge upEdge : myUpEdges.get(nodeIndex)) { if (upEdge.getType().isNormalEdge() && filter.upNormal) result.add(upEdge); if (!upEdge.getType().isNormalEdge() && filter.special) result.add(upEdge); } for (GraphEdge downEdge : myDownEdges.get(nodeIndex)) { if (downEdge.getType().isNormalEdge() && filter.downNormal) result.add(downEdge); if (!downEdge.getType().isNormalEdge() && filter.special) result.add(downEdge); } return result; } | getAdjacentEdges |
273,987 | GraphNode (int nodeIndex) { return myGraphNodes.get(nodeIndex); } | getGraphNode |
273,988 | int (int nodeIndex) { assert nodeIndex > 0 && nodeIndex < nodesCount() : "Bad nodeIndex: " + nodeIndex; return nodeIndex; } | getNodeId |
273,989 | Integer (int nodeId) { if (nodeId >= 0 && nodeId < nodesCount()) return nodeId; return null; } | getNodeIndex |
273,990 | SimpleCommit<Integer> (@NotNull String commitHash, String @NotNull [] parentsHashes) { int intCommitHash = CommitParser.createHash(commitHash); List<Integer> parents = new ArrayList<>(); for (String parentsHash : parentsHashes) { if (parentsHash.length() > 0) { parents.add(CommitParser.createHash(parentsHash)); } } return new SimpleCommit<>(intCommitHash, parents, intCommitHash); } | asIntegerCommit |
273,991 | SimpleCommit<String> (@NotNull String commitHash, String @NotNull [] parentsHashes) { int timestamp = CommitParser.createHash(commitHash); List<String> parents = new ArrayList<>(); for (String parentsHash : parentsHashes) { if (parentsHash.length() > 0) { parents.add(parentsHash); } } return new SimpleCommit<>(commitHash, parents, timestamp); } | asStringCommit |
273,992 | CommitId () { return myId; } | getId |
273,993 | List<CommitId> () { return myParents; } | getParents |
273,994 | long () { return myTimestamp; } | getTimestamp |
273,995 | GraphNodeType (char type) { GraphNodeType nodeType = GRAPH_NODE_TYPE_MAP.get(type); if (nodeType == null) throw new IllegalStateException("Illegal char for graph node type: " + type); return nodeType; } | parseGraphNodeType |
273,996 | GraphEdgeType (char type) { GraphEdgeType nodeType = GRAPH_EDGE_TYPE_MAP.get(type); if (nodeType == null) throw new IllegalStateException("Illegal char for graph edge type: " + type); return nodeType; } | parseGraphEdgeType |
273,997 | char (@NotNull GraphEdgeType type) { return REVERSE_GRAPH_EDGE_TYPE_MAP.get(type); } | toChar |
273,998 | char (@NotNull GraphNodeType type) { return REVERSE_GRAPH_NODE_TYPE_MAP.get(type); } | toChar |
273,999 | int (@NotNull String line, int startIndex) { int nextIndex = line.indexOf(SEPARATOR, startIndex); if (nextIndex == -1) { throw new IllegalArgumentException("not found separator \"" + SEPARATOR + "\", with startIndex=" + startIndex + ", in line: " + line); } return nextIndex; } | nextSeparatorIndex |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.