id
stringlengths
7
14
test_class
dict
test_case
dict
focal_class
dict
focal_method
dict
repository
dict
11309044_0
{ "fields": [], "file": "lintools-datatypes-fastutil/src/test/java/tl/lin/data/map/Int2IntOpenHashMapWritableTest.java", "identifier": "Int2IntOpenHashMapWritableTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testIncrement() throws IOException {\n Int2IntOpenHashMapWritable m = new Int2IntOpenHashMapWritable();\n\n m.put(2, 7);\n m.put(1, 29);\n\n assertEquals(7, m.get(2));\n assertEquals(29, m.get(1));\n\n m.increment(2);\n m.increment(1);\n m.increment(3);\n\n a...
{ "fields": [ { "declarator": "serialVersionUID = 1255879065743242L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 1255879065743242L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "LAZY_DECODE...
{ "body": "public void increment(int key) {\n increment(key, 1);\n }", "class_method_signature": "Int2IntOpenHashMapWritable.increment(int key)", "constructor": false, "full_signature": "public void increment(int key)", "identifier": "increment", "invocations": [ "increment" ], "modifiers": "pub...
{ "created": null, "fork": null, "fork_count": 31, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11309044, "size": 575, "stargazer_count": 17, "stars": null, "updates": null, "url": "https://github.com/lintool/tools" }
11309044_59
{ "fields": [ { "declarator": "neg_one = -1", "modifier": "", "original_string": "int neg_one = -1, zero = 0, one = 1, two = 2, three = 3, four = 4, five = 5, six = 6, seven = 7,\n nine = 9;", "type": "int", "var_name": "neg_one" } ], "file": "lintools-datatypes/src/test...
{ "body": "@Test\n public void testToString1() {\n assertEquals(\"[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\", new ArrayListOfInts(1, 11).toString());\n assertEquals(\"[1, 2, 3, 4, 5 ... (5 more) ]\", new ArrayListOfInts(1, 11).toString(5));\n\n assertEquals(\"[1, 2, 3, 4, 5]\", new ArrayListOfInts(1, 6).toString());...
{ "fields": [ { "declarator": "array", "modifier": "protected transient", "original_string": "protected transient int[] array;", "type": "int[]", "var_name": "array" }, { "declarator": "size = 0", "modifier": "protected", "original_string": "protected int si...
{ "body": "public String toString(int n) {\n StringBuilder s = new StringBuilder();\n\n s.append(\"[\");\n int sz = size() > n ? n : size;\n\n for (int i = 0; i < sz; i++) {\n s.append(get(i));\n if (i < sz - 1) {\n s.append(\", \");\n }\n }\n\n s.append(size() > n ? String.for...
{ "created": null, "fork": null, "fork_count": 31, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11309044, "size": 575, "stargazer_count": 17, "stars": null, "updates": null, "url": "https://github.com/lintool/tools" }
11309044_79
{ "fields": [ { "declarator": "neg_one = -1", "modifier": "", "original_string": "short neg_one = -1, zero = 0, one = 1, two = 2, three = 3, four = 4, five = 5, six = 6,\n seven = 7, nine = 9;", "type": "short", "var_name": "neg_one" } ], "file": "lintools-datatypes/src/...
{ "body": "@Test\n public void testRemove() {\n ArrayListOfShorts list = new ArrayListOfShorts();\n for (int i = 0; i < 10; i++) {\n list.add((short) i);\n }\n\n list.remove(list.indexOf((short) 5));\n assertEquals(9, list.size());\n assertEquals(0, list.get(0));\n assertEquals(1, list.get(...
{ "fields": [ { "declarator": "array", "modifier": "protected transient", "original_string": "protected transient short[] array;", "type": "short[]", "var_name": "array" }, { "declarator": "size", "modifier": "protected", "original_string": "protected int si...
{ "body": "public short remove(int index) {\n if (index >= size) {\n throw new ArrayIndexOutOfBoundsException();\n }\n short oldValue = array[index];\n\n int numMoved = size - index - 1;\n if (numMoved > 0) {\n System.arraycopy(array, index + 1, array, index, numMoved);\n }\n\n size--;\...
{ "created": null, "fork": null, "fork_count": 31, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11309044, "size": 575, "stargazer_count": 17, "stars": null, "updates": null, "url": "https://github.com/lintool/tools" }
11309044_96
{ "fields": [ { "declarator": "neg_one = -1", "modifier": "", "original_string": "long neg_one = -1, zero = 0, one = 1, two = 2, three = 3, four = 4, five = 5, six = 6, seven = 7,\n nine = 9;", "type": "long", "var_name": "neg_one" } ], "file": "lintools-datatypes/src/te...
{ "body": "@Test\n public void testAddUnique() {\n ArrayListOfLongs a = new ArrayListOfLongs(new long[] { 1, 2, 3, 4, 5, 6, 7 });\n a.addUnique(new long[] { 8, 0, 2, 5, -1, 11, 9 });\n assertEquals(12, a.size());\n assertEquals(0, a.get(8));\n assertEquals(-1, a.get(9));\n assertEquals(11, a.get(10...
{ "fields": [ { "declarator": "array", "modifier": "protected transient", "original_string": "protected transient long[] array;", "type": "long[]", "var_name": "array" }, { "declarator": "size = 0", "modifier": "protected", "original_string": "protected int ...
{ "body": "public void addUnique(long[] arr) {\n for (int i = 0; i < arr.length; i++) {\n long elt = arr[i];\n if (!contains(elt)) {\n add(elt);\n }\n }\n }", "class_method_signature": "ArrayListOfLongs.addUnique(long[] arr)", "constructor": false, "full_signature": "public void add...
{ "created": null, "fork": null, "fork_count": 31, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11309044, "size": 575, "stargazer_count": 17, "stars": null, "updates": null, "url": "https://github.com/lintool/tools" }
11309044_106
{ "fields": [], "file": "lintools-datatypes/src/test/java/tl/lin/data/map/HMapIITest.java", "identifier": "HMapIITest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testPut() {\n HMapII m = new HMapII();\n // When we put a value, we should get back the old value.\n\n assertEquals(MapII.DEFAULT_VALUE, m.put(1, 5));\n assertEquals(5, m.put(1, 6));\n assertEquals(6, m.put(1, 2));\n assertEquals(2, m.get(1));\n }", "class_method_s...
{ "fields": [ { "declarator": "DEFAULT_INITIAL_CAPACITY = 1024", "modifier": "static final", "original_string": "static final int DEFAULT_INITIAL_CAPACITY = 1024;", "type": "int", "var_name": "DEFAULT_INITIAL_CAPACITY" }, { "declarator": "MAXIMUM_CAPACITY = 1 << 30", ...
{ "body": "@Override\n public int put(int key, int value) {\n int hash = hash(key);\n int i = indexFor(hash, table.length);\n for (Entry e = table[i]; e != null; e = e.next) {\n int k;\n if (e.hash == hash && ((k = e.key) == key || key == k)) {\n int oldValue = e.value;\n e.value = v...
{ "created": null, "fork": null, "fork_count": 31, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11309044, "size": 575, "stargazer_count": 17, "stars": null, "updates": null, "url": "https://github.com/lintool/tools" }
11309044_38
{ "fields": [ { "declarator": "neg_one = -1", "modifier": "", "original_string": "long neg_one = -1, zero = 0, one = 1, two = 2, three = 3, four = 4, five = 5, six = 6, seven = 7,\n nine = 9;", "type": "long", "var_name": "neg_one" } ], "file": "lintools-datatypes/src/te...
{ "body": "@Test\n public void testCompare() {\n ArrayListOfLongsWritable a = new ArrayListOfLongsWritable();\n a.add(one).add(three).add(five);\n\n ArrayListOfLongsWritable b = new ArrayListOfLongsWritable();\n\n // [1,3,5] < [1,3,5,7]\n b.add(one).add(three).add(five).add(seven);\n assertTrue(b.c...
{ "fields": [], "file": "lintools-datatypes/src/main/java/tl/lin/data/array/ArrayListOfLongsWritable.java", "identifier": "ArrayListOfLongsWritable", "interfaces": "implements\n WritableComparable<ArrayListOfLongsWritable>", "methods": [ { "class_method_signature": "ArrayListOfLongsWritable.Array...
{ "body": "@Override\n public int compareTo(ArrayListOfLongsWritable obj) {\n ArrayListOfLongsWritable other = (ArrayListOfLongsWritable) obj;\n if (isEmpty()) {\n if (other.isEmpty()) {\n return 0;\n } else {\n return -1;\n }\n }\n\n for (int i = 0; i < size(); i++) {\n ...
{ "created": null, "fork": null, "fork_count": 31, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11309044, "size": 575, "stargazer_count": 17, "stars": null, "updates": null, "url": "https://github.com/lintool/tools" }
11309044_80
{ "fields": [ { "declarator": "neg_one = -1", "modifier": "", "original_string": "short neg_one = -1, zero = 0, one = 1, two = 2, three = 3, four = 4, five = 5, six = 6,\n seven = 7, nine = 9;", "type": "short", "var_name": "neg_one" } ], "file": "lintools-datatypes/src/...
{ "body": "@Test\n public void testClone() {\n int size = 10000;\n Random r = new Random();\n int[] shorts = new int[size];\n\n ArrayListOfShorts list1 = new ArrayListOfShorts();\n for (int i = 0; i < size; i++) {\n short k = (short) r.nextInt(size);\n list1.add(k);\n shorts[i] = k;\n ...
{ "fields": [ { "declarator": "array", "modifier": "protected transient", "original_string": "protected transient short[] array;", "type": "short[]", "var_name": "array" }, { "declarator": "size", "modifier": "protected", "original_string": "protected int si...
{ "body": "public ArrayListOfShorts clone() {\n return new ArrayListOfShorts(Arrays.copyOf(array, this.size()));\n }", "class_method_signature": "ArrayListOfShorts.clone()", "constructor": false, "full_signature": "public ArrayListOfShorts clone()", "identifier": "clone", "invocations": [ "copyOf", ...
{ "created": null, "fork": null, "fork_count": 31, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11309044, "size": 575, "stargazer_count": 17, "stars": null, "updates": null, "url": "https://github.com/lintool/tools" }
11309044_110
{ "fields": [], "file": "lintools-datatypes/src/test/java/tl/lin/data/map/HMapKSTest.java", "identifier": "HMapKSTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testDot() throws IOException {\n HMapKS<Text> m1 = new HMapKS<Text>();\n\n m1.put(new Text(\"hi\"), (short) 5);\n m1.put(new Text(\"there\"), (short) 2);\n m1.put(new Text(\"empty\"), (short) 3);\n\n HMapKS<Text> m2 = new HMapKS<Text>();\n\n m2.put(new Text(\"hi\"), (...
{ "fields": [ { "declarator": "DEFAULT_INITIAL_CAPACITY = 1024", "modifier": "static final", "original_string": "static final int DEFAULT_INITIAL_CAPACITY = 1024;", "type": "int", "var_name": "DEFAULT_INITIAL_CAPACITY" }, { "declarator": "MAXIMUM_CAPACITY = 1 << 30", ...
{ "body": "@Override\n public long dot(MapKS<K> m) {\n int s = 0;\n\n for (MapKS.Entry<K> e : m.entrySet()) {\n K key = e.getKey();\n\n if (this.containsKey(key)) {\n s += this.get(key) * e.getValue();\n }\n }\n\n return s;\n }", "class_method_signature": "HMapKS.dot(MapKS<K> m)"...
{ "created": null, "fork": null, "fork_count": 31, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11309044, "size": 575, "stargazer_count": 17, "stars": null, "updates": null, "url": "https://github.com/lintool/tools" }
11309044_14
{ "fields": [], "file": "lintools-datatypes-fastutil/src/test/java/tl/lin/data/map/Int2LongOpenHashMapWritableTest.java", "identifier": "Int2LongOpenHashMapWritableTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testSortedEntries3() {\n Int2LongOpenHashMapWritable m = new Int2LongOpenHashMapWritable();\n\n m.put(1, 5);\n m.put(2, 2);\n\n Int2LongMap.Entry[] e = m.getEntriesSortedByValue(5);\n\n assertEquals(2, e.length);\n\n assertEquals(1, e[0].getIntKey());\n assertEqual...
{ "fields": [ { "declarator": "serialVersionUID = 1029363828020488531L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 1029363828020488531L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "LAZY_...
{ "body": "public Int2LongMap.Entry[] getEntriesSortedByValue() {\n if (this.size() == 0)\n return null;\n\n Int2LongMap.Entry[] entries = new Int2LongMap.Entry[this.size()];\n entries = this.int2LongEntrySet().toArray(entries);\n\n // sort the entries\n Arrays.sort(entries, new Comparator<Int2Lon...
{ "created": null, "fork": null, "fork_count": 31, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11309044, "size": 575, "stargazer_count": 17, "stars": null, "updates": null, "url": "https://github.com/lintool/tools" }
11309044_43
{ "fields": [ { "declarator": "neg_one = -1", "modifier": "", "original_string": "float neg_one = -1, zero = 0, one = 1, two = 2, three = 3, four = 4, five = 5, six = 6,\n seven = 7, nine = 9;", "type": "float", "var_name": "neg_one" } ], "file": "lintools-datatypes/src/...
{ "body": "@Test\n public void testClone() {\n int size = 100000;\n Random r = new Random();\n float[] floats = new float[size];\n\n ArrayListOfFloats list1 = new ArrayListOfFloats();\n for (int i = 0; i < size; i++) {\n float k = r.nextFloat();\n list1.add(k);\n floats[i] = k;\n }\n...
{ "fields": [ { "declarator": "array", "modifier": "protected transient", "original_string": "protected transient float[] array;", "type": "float[]", "var_name": "array" }, { "declarator": "size = 0", "modifier": "protected", "original_string": "protected in...
{ "body": "public ArrayListOfFloats clone() {\n return new ArrayListOfFloats(Arrays.copyOf(array, this.size()));\n }", "class_method_signature": "ArrayListOfFloats.clone()", "constructor": false, "full_signature": "public ArrayListOfFloats clone()", "identifier": "clone", "invocations": [ "copyOf", ...
{ "created": null, "fork": null, "fork_count": 31, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11309044, "size": 575, "stargazer_count": 17, "stars": null, "updates": null, "url": "https://github.com/lintool/tools" }
11309044_55
{ "fields": [ { "declarator": "neg_one = -1", "modifier": "", "original_string": "int neg_one = -1, zero = 0, one = 1, two = 2, three = 3, four = 4, five = 5, six = 6, seven = 7,\n nine = 9;", "type": "int", "var_name": "neg_one" } ], "file": "lintools-datatypes/src/test...
{ "body": "@Test\n public void testInitialSize() {\n ArrayListOfInts a = new ArrayListOfInts();\n assertEquals(0, a.size());\n }", "class_method_signature": "ArrayListOfIntsTest.testInitialSize()", "constructor": false, "full_signature": "@Test public void testInitialSize()", "identifier": "testInitia...
{ "fields": [ { "declarator": "array", "modifier": "protected transient", "original_string": "protected transient int[] array;", "type": "int[]", "var_name": "array" }, { "declarator": "size = 0", "modifier": "protected", "original_string": "protected int si...
{ "body": "public int size() {\n return size;\n }", "class_method_signature": "ArrayListOfInts.size()", "constructor": false, "full_signature": "public int size()", "identifier": "size", "invocations": [], "modifiers": "public", "parameters": "()", "return": "int", "signature": "int size()", "...
{ "created": null, "fork": null, "fork_count": 31, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11309044, "size": 575, "stargazer_count": 17, "stars": null, "updates": null, "url": "https://github.com/lintool/tools" }
11309044_54
{ "fields": [ { "declarator": "neg_one = -1", "modifier": "", "original_string": "double neg_one = -1, zero = 0, one = 1, two = 2, three = 3, four = 4, five = 5, six = 6,\n seven = 7, nine = 9;", "type": "double", "var_name": "neg_one" } ], "file": "lintools-datatypes/sr...
{ "body": "@Test\n public void testCompare2() {\n // [1, 3, 6]\n ArrayListOfDoublesWritable a = new ArrayListOfDoublesWritable();\n a.add(one).add(three).add(six);\n\n // [1, 3, 4]\n ArrayListOfDoublesWritable b = new ArrayListOfDoublesWritable();\n b.add(one).add(three).add(four);\n assertTrue(...
{ "fields": [], "file": "lintools-datatypes/src/main/java/tl/lin/data/array/ArrayListOfDoublesWritable.java", "identifier": "ArrayListOfDoublesWritable", "interfaces": "implements\n WritableComparable<ArrayListOfDoublesWritable>", "methods": [ { "class_method_signature": "ArrayListOfDoublesWritab...
{ "body": "@Override\n public int compareTo(ArrayListOfDoublesWritable obj) {\n ArrayListOfDoublesWritable other = (ArrayListOfDoublesWritable) obj;\n if (isEmpty()) {\n if (other.isEmpty()) {\n return 0;\n } else {\n return -1;\n }\n }\n\n for (int i = 0; i < size(); i++) {\...
{ "created": null, "fork": null, "fork_count": 31, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11309044, "size": 575, "stargazer_count": 17, "stars": null, "updates": null, "url": "https://github.com/lintool/tools" }
11309044_42
{ "fields": [ { "declarator": "neg_one = -1", "modifier": "", "original_string": "float neg_one = -1, zero = 0, one = 1, two = 2, three = 3, four = 4, five = 5, six = 6,\n seven = 7, nine = 9;", "type": "float", "var_name": "neg_one" } ], "file": "lintools-datatypes/src/...
{ "body": "@Test\n public void testRemove() {\n ArrayListOfFloats list = new ArrayListOfFloats();\n for (int i = 0; i < 10; i++) {\n list.add((float) i);\n }\n\n list.remove(list.indexOf(5.0f));\n assertEquals(9, list.size());\n assertEquals(0.0f, list.get(0), 10e-6);\n assertEquals(1.0f, l...
{ "fields": [ { "declarator": "array", "modifier": "protected transient", "original_string": "protected transient float[] array;", "type": "float[]", "var_name": "array" }, { "declarator": "size = 0", "modifier": "protected", "original_string": "protected in...
{ "body": "public float remove(int index) {\n if (index >= size) {\n throw new ArrayIndexOutOfBoundsException();\n }\n float oldValue = array[index];\n\n int numMoved = size - index - 1;\n if (numMoved > 0) {\n System.arraycopy(array, index + 1, array, index, numMoved);\n }\n\n size--;\...
{ "created": null, "fork": null, "fork_count": 31, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11309044, "size": 575, "stargazer_count": 17, "stars": null, "updates": null, "url": "https://github.com/lintool/tools" }
11309044_15
{ "fields": [], "file": "lintools-datatypes-fastutil/src/test/java/tl/lin/data/map/Int2LongOpenHashMapWritableTest.java", "identifier": "Int2LongOpenHashMapWritableTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testSortedEntries4() {\n Int2LongOpenHashMapWritable m = new Int2LongOpenHashMapWritable();\n\n Int2LongMap.Entry[] e = m.getEntriesSortedByValue();\n assertTrue(e == null);\n }", "class_method_signature": "Int2LongOpenHashMapWritableTest.testSortedEntries4()", "construct...
{ "fields": [ { "declarator": "serialVersionUID = 1029363828020488531L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 1029363828020488531L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "LAZY_...
{ "body": "public Int2LongMap.Entry[] getEntriesSortedByValue() {\n if (this.size() == 0)\n return null;\n\n Int2LongMap.Entry[] entries = new Int2LongMap.Entry[this.size()];\n entries = this.int2LongEntrySet().toArray(entries);\n\n // sort the entries\n Arrays.sort(entries, new Comparator<Int2Lon...
{ "created": null, "fork": null, "fork_count": 31, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11309044, "size": 575, "stargazer_count": 17, "stars": null, "updates": null, "url": "https://github.com/lintool/tools" }
11309044_111
{ "fields": [], "file": "lintools-datatypes/src/test/java/tl/lin/data/map/HMapKSTest.java", "identifier": "HMapKSTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testIncrement() {\n HMapKS<String> m = new HMapKS<String>();\n assertEquals(0, m.get(\"one\"));\n\n m.increment(\"one\", (short) 1);\n assertEquals(1, m.get(\"one\"));\n\n m.increment(\"one\", (short) 1);\n m.increment(\"two\", (short) 0);\n m.increment(\"three\", ...
{ "fields": [ { "declarator": "DEFAULT_INITIAL_CAPACITY = 1024", "modifier": "static final", "original_string": "static final int DEFAULT_INITIAL_CAPACITY = 1024;", "type": "int", "var_name": "DEFAULT_INITIAL_CAPACITY" }, { "declarator": "MAXIMUM_CAPACITY = 1 << 30", ...
{ "body": "@Override\n public void increment(K key) {\n if (this.containsKey(key)) {\n this.put(key, (short) (this.get(key) + 1));\n } else {\n this.put(key, (short) 1);\n }\n }", "class_method_signature": "HMapKS.increment(K key)", "constructor": false, "full_signature": "@Override public ...
{ "created": null, "fork": null, "fork_count": 31, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11309044, "size": 575, "stargazer_count": 17, "stars": null, "updates": null, "url": "https://github.com/lintool/tools" }
11309044_81
{ "fields": [ { "declarator": "neg_one = -1", "modifier": "", "original_string": "short neg_one = -1, zero = 0, one = 1, two = 2, three = 3, four = 4, five = 5, six = 6,\n seven = 7, nine = 9;", "type": "short", "var_name": "neg_one" } ], "file": "lintools-datatypes/src/...
{ "body": "@Test\n public void testToString1() {\n assertEquals(\"[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\",\n new ArrayListOfShorts((short) 1, (short) 11).toString());\n assertEquals(\"[1, 2, 3, 4, 5 ... (5 more) ]\",\n new ArrayListOfShorts((short) 1, (short) 11).toString(5));\n\n assertEquals(\"[1,...
{ "fields": [ { "declarator": "array", "modifier": "protected transient", "original_string": "protected transient short[] array;", "type": "short[]", "var_name": "array" }, { "declarator": "size", "modifier": "protected", "original_string": "protected int si...
{ "body": "public String toString(int n) {\n StringBuilder s = new StringBuilder();\n\n s.append(\"[\");\n int sz = size() > n ? n : size;\n\n for (int i = 0; i < sz; i++) {\n s.append(get(i));\n if (i < sz - 1) {\n s.append(\", \");\n }\n }\n\n s.append(size() > n ? String.for...
{ "created": null, "fork": null, "fork_count": 31, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11309044, "size": 575, "stargazer_count": 17, "stars": null, "updates": null, "url": "https://github.com/lintool/tools" }
11309044_39
{ "fields": [ { "declarator": "neg_one = -1", "modifier": "", "original_string": "long neg_one = -1, zero = 0, one = 1, two = 2, three = 3, four = 4, five = 5, six = 6, seven = 7,\n nine = 9;", "type": "long", "var_name": "neg_one" } ], "file": "lintools-datatypes/src/te...
{ "body": "@Test\n public void testCompare2() {\n // [1, 3, 6]\n ArrayListOfLongsWritable a = new ArrayListOfLongsWritable();\n a.add(one).add(three).add(six);\n\n // [1, 3, 4]\n ArrayListOfLongsWritable b = new ArrayListOfLongsWritable();\n b.add(one).add(three).add(four);\n assertTrue(a.compar...
{ "fields": [], "file": "lintools-datatypes/src/main/java/tl/lin/data/array/ArrayListOfLongsWritable.java", "identifier": "ArrayListOfLongsWritable", "interfaces": "implements\n WritableComparable<ArrayListOfLongsWritable>", "methods": [ { "class_method_signature": "ArrayListOfLongsWritable.Array...
{ "body": "@Override\n public int compareTo(ArrayListOfLongsWritable obj) {\n ArrayListOfLongsWritable other = (ArrayListOfLongsWritable) obj;\n if (isEmpty()) {\n if (other.isEmpty()) {\n return 0;\n } else {\n return -1;\n }\n }\n\n for (int i = 0; i < size(); i++) {\n ...
{ "created": null, "fork": null, "fork_count": 31, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11309044, "size": 575, "stargazer_count": 17, "stars": null, "updates": null, "url": "https://github.com/lintool/tools" }
11309044_107
{ "fields": [], "file": "lintools-datatypes/src/test/java/tl/lin/data/map/HMapILWTest.java", "identifier": "HMapILWTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testBasic() throws IOException {\n HMapILW m = new HMapILW();\n\n m.put(2, Integer.MAX_VALUE + 5L);\n m.put(1, Integer.MAX_VALUE + 22L);\n\n long value;\n\n assertEquals(m.size(), 2);\n\n value = m.get(2);\n assertEquals(Integer.MAX_VALUE + 5L, value);\n assertT...
{ "fields": [ { "declarator": "LazyDecode = false", "modifier": "private static", "original_string": "private static boolean LazyDecode = false;", "type": "boolean", "var_name": "LazyDecode" }, { "declarator": "serialVersionUID = 2794563945L", "modifier": "private...
{ "body": "@Override\n public int size() {\n if (!isDecoded()) {\n return keys.length;\n }\n\n return super.size();\n }", "class_method_signature": "HMapILW.size()", "constructor": false, "full_signature": "@Override public int size()", "identifier": "size", "invocations": [ "isDecoded",...
{ "created": null, "fork": null, "fork_count": 31, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11309044, "size": 575, "stargazer_count": 17, "stars": null, "updates": null, "url": "https://github.com/lintool/tools" }
11309044_78
{ "fields": [ { "declarator": "neg_one = -1", "modifier": "", "original_string": "short neg_one = -1, zero = 0, one = 1, two = 2, three = 3, four = 4, five = 5, six = 6,\n seven = 7, nine = 9;", "type": "short", "var_name": "neg_one" } ], "file": "lintools-datatypes/src/...
{ "body": "@Test\n public void testArrayConstructor() {\n short[] arr = new short[] { 1, 2, 3, 4, 5 };\n assertEquals(5, arr.length);\n\n ArrayListOfShorts list = new ArrayListOfShorts(arr);\n list.remove(2);\n\n // Make sure the original array remains untouched.\n assertEquals(1, arr[0]);\n ass...
{ "fields": [ { "declarator": "array", "modifier": "protected transient", "original_string": "protected transient short[] array;", "type": "short[]", "var_name": "array" }, { "declarator": "size", "modifier": "protected", "original_string": "protected int si...
{ "body": "public short remove(int index) {\n if (index >= size) {\n throw new ArrayIndexOutOfBoundsException();\n }\n short oldValue = array[index];\n\n int numMoved = size - index - 1;\n if (numMoved > 0) {\n System.arraycopy(array, index + 1, array, index, numMoved);\n }\n\n size--;\...
{ "created": null, "fork": null, "fork_count": 31, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11309044, "size": 575, "stargazer_count": 17, "stars": null, "updates": null, "url": "https://github.com/lintool/tools" }
11309044_97
{ "fields": [ { "declarator": "neg_one = -1", "modifier": "", "original_string": "short neg_one = -1, zero = 0, one = 1, two = 2, three = 3, four = 4, five = 5, six = 6,\n seven = 7, nine = 9;", "type": "short", "var_name": "neg_one" } ], "file": "lintools-datatypes/src/...
{ "body": "@Test\n public void testToString() {\n assertEquals(\"[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\", new ArrayListOfShortsWritable((short) 1,\n (short) 11).toString());\n assertEquals(\"[1, 2, 3, 4, 5 ... (5 more) ]\", new ArrayListOfShortsWritable((short) 1,\n (short) 11).toString(5));\n\n ass...
{ "fields": [], "file": "lintools-datatypes/src/main/java/tl/lin/data/array/ArrayListOfShortsWritable.java", "identifier": "ArrayListOfShortsWritable", "interfaces": "implements\n WritableComparable<ArrayListOfShortsWritable>", "methods": [ { "class_method_signature": "ArrayListOfShortsWritable.A...
{ "body": "@Override\n public String toString() {\n return toString(size());\n }", "class_method_signature": "ArrayListOfShortsWritable.toString()", "constructor": false, "full_signature": "@Override public String toString()", "identifier": "toString", "invocations": [ "toString", "size" ], ...
{ "created": null, "fork": null, "fork_count": 31, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11309044, "size": 575, "stargazer_count": 17, "stars": null, "updates": null, "url": "https://github.com/lintool/tools" }
11309044_58
{ "fields": [ { "declarator": "neg_one = -1", "modifier": "", "original_string": "int neg_one = -1, zero = 0, one = 1, two = 2, three = 3, four = 4, five = 5, six = 6, seven = 7,\n nine = 9;", "type": "int", "var_name": "neg_one" } ], "file": "lintools-datatypes/src/test...
{ "body": "@Test\n public void testClone() {\n int size = 100000;\n Random r = new Random();\n int[] ints = new int[size];\n\n ArrayListOfInts list1 = new ArrayListOfInts();\n for (int i = 0; i < size; i++) {\n int k = r.nextInt(size);\n list1.add(k);\n ints[i] = k;\n }\n\n ArrayL...
{ "fields": [ { "declarator": "array", "modifier": "protected transient", "original_string": "protected transient int[] array;", "type": "int[]", "var_name": "array" }, { "declarator": "size = 0", "modifier": "protected", "original_string": "protected int si...
{ "body": "public ArrayListOfInts clone() {\n return new ArrayListOfInts(Arrays.copyOf(array, this.size()));\n }", "class_method_signature": "ArrayListOfInts.clone()", "constructor": false, "full_signature": "public ArrayListOfInts clone()", "identifier": "clone", "invocations": [ "copyOf", "siz...
{ "created": null, "fork": null, "fork_count": 31, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11309044, "size": 575, "stargazer_count": 17, "stars": null, "updates": null, "url": "https://github.com/lintool/tools" }
11309044_127
{ "fields": [], "file": "lintools-datatypes/src/test/java/tl/lin/data/map/HMapIDTest.java", "identifier": "HMapIDTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testDot() throws IOException {\n HMapID m1 = new HMapID();\n\n m1.put(1, 2.3);\n m1.put(2, 1.9);\n m1.put(3, 3.0);\n\n HMapID m2 = new HMapID();\n\n m2.put(1, 1.2);\n m2.put(2, 4.3);\n m2.put(4, 5.0);\n\n double s = m1.dot(m2);\n\n assertTrue(s == 10.93);\...
{ "fields": [ { "declarator": "DEFAULT_INITIAL_CAPACITY = 1024", "modifier": "static final", "original_string": "static final int DEFAULT_INITIAL_CAPACITY = 1024;", "type": "int", "var_name": "DEFAULT_INITIAL_CAPACITY" }, { "declarator": "MAXIMUM_CAPACITY = 1 << 30", ...
{ "body": "@Override\n public double dot(MapID m) {\n double s = 0.0f;\n\n for (MapID.Entry e : m.entrySet()) {\n int key = e.getKey();\n\n if (this.containsKey(key)) {\n s += this.get(key) * e.getValue();\n }\n }\n\n return s;\n }", "class_method_signature": "HMapID.dot(MapID m)...
{ "created": null, "fork": null, "fork_count": 31, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11309044, "size": 575, "stargazer_count": 17, "stars": null, "updates": null, "url": "https://github.com/lintool/tools" }
11309044_1
{ "fields": [], "file": "lintools-datatypes-fastutil/src/test/java/tl/lin/data/map/Int2IntOpenHashMapWritableTest.java", "identifier": "Int2IntOpenHashMapWritableTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testPlus() throws IOException {\n Int2IntOpenHashMapWritable m1 = new Int2IntOpenHashMapWritable();\n\n m1.put(1, 5);\n m1.put(2, 22);\n\n Int2IntOpenHashMapWritable m2 = new Int2IntOpenHashMapWritable();\n\n m2.put(1, 4);\n m2.put(3, 5);\n\n m1.plus(m2);\n\n as...
{ "fields": [ { "declarator": "serialVersionUID = 1255879065743242L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 1255879065743242L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "LAZY_DECODE...
{ "body": "public void plus(Int2IntOpenHashMapWritable m) {\n for (Int2IntMap.Entry e : m.int2IntEntrySet()) {\n int key = e.getIntKey();\n int value = e.getIntValue();\n\n if (this.containsKey(key)) {\n this.put(key, this.get(key) + value);\n } else {\n this.put(key, value);\n ...
{ "created": null, "fork": null, "fork_count": 31, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11309044, "size": 575, "stargazer_count": 17, "stars": null, "updates": null, "url": "https://github.com/lintool/tools" }
11309044_131
{ "fields": [], "file": "lintools-datatypes/src/test/java/tl/lin/data/map/HMapISTest.java", "identifier": "HMapISTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testDot() throws IOException {\n HMapIS m1 = new HMapIS();\n\n m1.put(1, (short) 2);\n m1.put(2, (short) 1);\n m1.put(3, (short) 3);\n\n HMapIS m2 = new HMapIS();\n\n m2.put(1, (short) 1);\n m2.put(2, (short) 4);\n m2.put(4, (short) 5);\n\n long s = m1.dot(m2...
{ "fields": [ { "declarator": "DEFAULT_INITIAL_CAPACITY = 1024", "modifier": "static final", "original_string": "static final int DEFAULT_INITIAL_CAPACITY = 1024;", "type": "int", "var_name": "DEFAULT_INITIAL_CAPACITY" }, { "declarator": "MAXIMUM_CAPACITY = 1 << 30", ...
{ "body": "@Override\n public long dot(MapIS m) {\n int s = 0;\n\n for (MapIS.Entry e : m.entrySet()) {\n int key = e.getKey();\n\n if (this.containsKey(key)) {\n s += this.get(key) * e.getValue();\n }\n }\n\n return s;\n }", "class_method_signature": "HMapIS.dot(MapIS m)", "co...
{ "created": null, "fork": null, "fork_count": 31, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11309044, "size": 575, "stargazer_count": 17, "stars": null, "updates": null, "url": "https://github.com/lintool/tools" }
11309044_19
{ "fields": [], "file": "lintools-datatypes-fastutil/src/test/java/tl/lin/data/map/Int2FloatOpenHashMapWritableTest.java", "identifier": "Int2FloatOpenHashMapWritableTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testDot() throws IOException {\n Int2FloatOpenHashMapWritable m1 = new Int2FloatOpenHashMapWritable();\n\n m1.put(1, 2.0f);\n m1.put(2, 1.0f);\n m1.put(3, 3.0f);\n\n Int2FloatOpenHashMapWritable m2 = new Int2FloatOpenHashMapWritable();\n\n m2.put(1, 1.0f);\n m2.put...
{ "fields": [ { "declarator": "serialVersionUID = 674980125439241L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 674980125439241L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "LAZY_DECODE =...
{ "body": "public int dot(Int2FloatOpenHashMapWritable m) {\n int s = 0;\n\n for (Int2FloatMap.Entry e : m.int2FloatEntrySet()) {\n int key = e.getKey();\n\n if (this.containsKey(key)) {\n s += this.get(key) * e.getValue();\n }\n }\n\n return s;\n }", "class_method_signature": "In...
{ "created": null, "fork": null, "fork_count": 31, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11309044, "size": 575, "stargazer_count": 17, "stars": null, "updates": null, "url": "https://github.com/lintool/tools" }
11309044_62
{ "fields": [ { "declarator": "neg_one = -1", "modifier": "", "original_string": "int neg_one = -1, zero = 0, one = 1, two = 2, three = 3, four = 4, five = 5, six = 6, seven = 7,\n nine = 9;", "type": "int", "var_name": "neg_one" } ], "file": "lintools-datatypes/src/test...
{ "body": "@Test\n public void testSort() {\n ArrayListOfInts a = new ArrayListOfInts();\n assertEquals(0, a.size());\n\n a.add(5).add(6).add(1).add(4);\n assertEquals(4, a.size());\n\n a.sort();\n assertEquals(4, a.size());\n\n assertEquals(1, a.get(0));\n assertEquals(4, a.get(1));\n ass...
{ "fields": [ { "declarator": "array", "modifier": "protected transient", "original_string": "protected transient int[] array;", "type": "int[]", "var_name": "array" }, { "declarator": "size = 0", "modifier": "protected", "original_string": "protected int si...
{ "body": "public void sort() {\n trimToSize();\n Arrays.sort(getArray());\n }", "class_method_signature": "ArrayListOfInts.sort()", "constructor": false, "full_signature": "public void sort()", "identifier": "sort", "invocations": [ "trimToSize", "sort", "getArray" ], "modifiers": "p...
{ "created": null, "fork": null, "fork_count": 31, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11309044, "size": 575, "stargazer_count": 17, "stars": null, "updates": null, "url": "https://github.com/lintool/tools" }
11309044_35
{ "fields": [], "file": "lintools-datatypes/src/test/java/tl/lin/data/array/ArrayListWritableComparableTest.java", "identifier": "ArrayListWritableComparableTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testSorting2() {\n ArrayListWritableComparable<Text> list1 = new ArrayListWritableComparable<Text>();\n ArrayListWritableComparable<Text> list2 = new ArrayListWritableComparable<Text>();\n\n list1.add(new Text(\"a\"));\n list2.add(new Text(\"b\"));\n\n assertTrue(list1.c...
{ "fields": [ { "declarator": "serialVersionUID = 4911321393319821792L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 4911321393319821792L;", "type": "long", "var_name": "serialVersionUID" } ], "file": "lintools-datatype...
{ "body": "public int compareTo(ArrayListWritableComparable<E> obj) {\n ArrayListWritableComparable<E> that = (ArrayListWritableComparable<E>) obj;\n\n // iterate through the fields\n for (int i = 0; i < this.size(); i++) {\n // sort shorter list first\n if (i >= that.size())\n return 1;\n\n...
{ "created": null, "fork": null, "fork_count": 31, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11309044, "size": 575, "stargazer_count": 17, "stars": null, "updates": null, "url": "https://github.com/lintool/tools" }
11309044_23
{ "fields": [], "file": "lintools-datatypes-fastutil/src/test/java/tl/lin/data/map/Int2FloatOpenHashMapWritableTest.java", "identifier": "Int2FloatOpenHashMapWritableTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testSortedEntries4() {\n Int2FloatOpenHashMapWritable m = new Int2FloatOpenHashMapWritable();\n\n Int2FloatMap.Entry[] e = m.getEntriesSortedByValue();\n assertTrue(e == null);\n }", "class_method_signature": "Int2FloatOpenHashMapWritableTest.testSortedEntries4()", "const...
{ "fields": [ { "declarator": "serialVersionUID = 674980125439241L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 674980125439241L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "LAZY_DECODE =...
{ "body": "public Int2FloatMap.Entry[] getEntriesSortedByValue() {\n if (this.size() == 0)\n return null;\n\n Int2FloatMap.Entry[] entries = new Int2FloatMap.Entry[this.size()];\n entries = this.int2FloatEntrySet().toArray(entries);\n\n // Sort the entries.\n Arrays.sort(entries, new Comparator<In...
{ "created": null, "fork": null, "fork_count": 31, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11309044, "size": 575, "stargazer_count": 17, "stars": null, "updates": null, "url": "https://github.com/lintool/tools" }
11309044_74
{ "fields": [ { "declarator": "neg_one = -1", "modifier": "", "original_string": "double neg_one = -1, zero = 0, one = 1, two = 2, three = 3, four = 4, five = 5, six = 6,\n seven = 7, nine = 9;", "type": "double", "var_name": "neg_one" } ], "file": "lintools-datatypes/sr...
{ "body": "@Test\n public void testAddUnique() {\n ArrayListOfDoubles a = new ArrayListOfDoubles(new double[] { 1, 2, 3, 4, 5, 6, 7 });\n a.addUnique(new int[] { 8, 0, 2, 5, -1, 11, 9 });\n\n assertEquals(12, a.size());\n assertTrue(Math.abs(0 - a.get(8)) < 0.0001);\n assertTrue(Math.abs(-1 - a.get(9)...
{ "fields": [ { "declarator": "array", "modifier": "protected transient", "original_string": "protected transient double[] array;", "type": "double[]", "var_name": "array" }, { "declarator": "size = 0", "modifier": "protected", "original_string": "protected ...
{ "body": "public void addUnique(int[] arr) {\n for (int i = 0; i < arr.length; i++) {\n int elt = arr[i];\n if (!contains(elt)) {\n add(elt);\n }\n }\n }", "class_method_signature": "ArrayListOfDoubles.addUnique(int[] arr)", "constructor": false, "full_signature": "public void addU...
{ "created": null, "fork": null, "fork_count": 31, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11309044, "size": 575, "stargazer_count": 17, "stars": null, "updates": null, "url": "https://github.com/lintool/tools" }
57180498_1
{ "fields": [], "file": "nvwa-codec-core/src/test/java/org/bigmouth/nvwa/codec/tlv/decoders/TLVStringArrayDecoderTest.java", "identifier": "TLVStringArrayDecoderTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testTLVStringArrayDecoder() {\n\t\tTLVEncoder<Object> tlvEncoder = TLVCodecProviders.newBigEndianTLVEncoderProvider()\n\t\t\t\t.getObjectEncoder();\n\t\tTLVDecoder<Object> tlvDecoder = TLVCodecProviders.newBigEndianTLVDecoderProvider()\n\t\t\t\t.getObjectDecoder();\n\n\t\tBean a = new ...
{ "fields": [ { "declarator": "DECODER_KEYES = new String[] { String[].class.getName() }", "modifier": "private static final", "original_string": "private static final String[] DECODER_KEYES = new String[] { String[].class.getName() };", "type": "String[]", "var_name": "DECODER_KEYES...
{ "body": "@SuppressWarnings(\"unchecked\")\n\t@Override\n\tpublic String[] codec(byte[] source, Object additionInfo) {\n\t\tif (null == decoderProvider)\n\t\t\tthrow new IllegalStateException(\"TLVbArrayDecoder must be registered to decodeContext.\");\n\t\tif (null == source)\n\t\t\treturn null;\n\n\t\tList<String> ...
{ "created": null, "fork": null, "fork_count": 25, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 57180498, "size": 5183, "stargazer_count": 15, "stars": null, "updates": null, "url": "https://github.com/big-mouth-cn/nvwa" }
57180498_0
{ "fields": [], "file": "nvwa-codec-core/src/test/java/org/bigmouth/nvwa/codec/tlv/decoders/TLVObjectDecoderTest.java", "identifier": "TLVObjectDecoderTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void test() {\n\t\tTLVEncoder<Object> tlvEncoder = TLVCodecProviders.newBigEndianTLVEncoderProvider()\n\t\t\t\t.getObjectEncoder();\n\t\tTLVDecoder<Object> tlvDecoder = TLVCodecProviders.newBigEndianTLVDecoderProvider()\n\t\t\t\t.getObjectDecoder();\n\n\t\tByteArrayOutputStream bos = new By...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(TLVObjectDecoder.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(TLVObjectDecoder.class);", "type": "Logger", "var_name": "LOGGER" }, ...
{ "body": "@SuppressWarnings(\"unchecked\")\n\t@Override\n\tpublic Object codec(byte[] source, Object targetClass) {\n\t\t// targetObject is type of tlv annotation class\n\t\tif (null == source || null == targetClass)\n\t\t\tthrow new NullPointerException(\"source is null or targetObject is null.\");\n\n\t\tif (!(tar...
{ "created": null, "fork": null, "fork_count": 25, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 57180498, "size": 5183, "stargazer_count": 15, "stars": null, "updates": null, "url": "https://github.com/big-mouth-cn/nvwa" }
20576090_0
{ "fields": [], "file": "app/src/test/java/com/boarbeard/audio/TestMissionLog.java", "identifier": "TestMissionLog", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testColorToHTML() {\n assertEquals(\"#C7EBFC\", MissionLog.colorToHTML(0xffc7ebfc));\n assertEquals(\"#C7EBFC\", MissionLog.colorToHTML(0xc7ebfc));\n assertEquals(\"#07EBFC\", MissionLog.colorToHTML(0xff07ebfc));\n assertEquals(\"#07EBFC\", MissionLog.colo...
{ "fields": [ { "declarator": "actionText", "modifier": "private final", "original_string": "private final CharSequence actionText;", "type": "CharSequence", "var_name": "actionText" }, { "declarator": "clockText", "modifier": "private final", "original_stri...
{ "body": "static String colorToHTML(int argb) {\n return String.format(\"#%06X\", argb & 0xffffff);\n }", "class_method_signature": "MissionLog.colorToHTML(int argb)", "constructor": false, "full_signature": "static String colorToHTML(int argb)", "identifier": "colorToHTML", "invocations": [ ...
{ "created": null, "fork": null, "fork_count": 6, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 20576090, "size": 2576, "stargazer_count": 11, "stars": null, "updates": null, "url": "https://github.com/nibuen/SpaceAlertMissionGenerator" }
17775087_0
{ "fields": [], "file": "app-catalog/volley/src/test/java/com/android/volley/RequestTest.java", "identifier": "RequestTest", "interfaces": "", "superclass": "" }
{ "body": "@Test public void compareTo() {\n int sequence = 0;\n TestRequest low = new TestRequest(Priority.LOW);\n low.setSequence(sequence++);\n TestRequest low2 = new TestRequest(Priority.LOW);\n low2.setSequence(sequence++);\n TestRequest high = new TestRequest(Priority.H...
{ "fields": [ { "declarator": "DEFAULT_PARAMS_ENCODING = \"UTF-8\"", "modifier": "private static final", "original_string": "private static final String DEFAULT_PARAMS_ENCODING = \"UTF-8\";", "type": "String", "var_name": "DEFAULT_PARAMS_ENCODING" }, { "declarator": "mE...
{ "body": "@Override\n public int compareTo(Request<T> other) {\n Priority left = this.getPriority();\n Priority right = other.getPriority();\n\n // High-priority requests are \"lesser\" so they are sorted to the front.\n // Equal priorities are sorted by sequence number to provide FIFO...
{ "created": null, "fork": null, "fork_count": 98, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17775087, "size": 18681, "stargazer_count": 35, "stars": null, "updates": null, "url": "https://github.com/wso2/cdmf-agent-android" }
17775087_11
{ "fields": [ { "declarator": "mMockRequest", "modifier": "@Mock private", "original_string": "@Mock private Request<String> mMockRequest;", "type": "Request<String>", "var_name": "mMockRequest" }, { "declarator": "mMockRetryPolicy", "modifier": "@Mock private", ...
{ "body": "@Test public void serverError_disableRetries() throws Exception {\n for (int i = 500; i <= 599; i++) {\n MockHttpStack mockHttpStack = new MockHttpStack();\n BasicHttpResponse fakeResponse =\n new BasicHttpResponse(new ProtocolVersion(\"HTTP\", 1, 1), i, \"\"...
{ "fields": [ { "declarator": "DEBUG = VolleyLog.DEBUG", "modifier": "protected static final", "original_string": "protected static final boolean DEBUG = VolleyLog.DEBUG;", "type": "boolean", "var_name": "DEBUG" }, { "declarator": "SLOW_REQUEST_THRESHOLD_MS = 3000", ...
{ "body": "@Override\n public NetworkResponse performRequest(Request<?> request) throws VolleyError {\n long requestStart = SystemClock.elapsedRealtime();\n while (true) {\n HttpResponse httpResponse = null;\n byte[] responseContents = null;\n Map<String, String> resp...
{ "created": null, "fork": null, "fork_count": 98, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17775087, "size": 18681, "stargazer_count": 35, "stars": null, "updates": null, "url": "https://github.com/wso2/cdmf-agent-android" }
17775087_1
{ "fields": [], "file": "app-catalog/volley/src/test/java/com/android/volley/RequestTest.java", "identifier": "RequestTest", "interfaces": "", "superclass": "" }
{ "body": "@Test public void urlParsing() {\n UrlParseRequest nullUrl = new UrlParseRequest(null);\n assertEquals(0, nullUrl.getTrafficStatsTag());\n UrlParseRequest emptyUrl = new UrlParseRequest(\"\");\n assertEquals(0, emptyUrl.getTrafficStatsTag());\n UrlParseRequest noHost = ne...
{ "fields": [ { "declarator": "DEFAULT_PARAMS_ENCODING = \"UTF-8\"", "modifier": "private static final", "original_string": "private static final String DEFAULT_PARAMS_ENCODING = \"UTF-8\";", "type": "String", "var_name": "DEFAULT_PARAMS_ENCODING" }, { "declarator": "mE...
{ "body": "public int getTrafficStatsTag() {\n return mDefaultTrafficStatsTag;\n }", "class_method_signature": "Request.getTrafficStatsTag()", "constructor": false, "full_signature": "public int getTrafficStatsTag()", "identifier": "getTrafficStatsTag", "invocations": [], "modifiers": "public", ...
{ "created": null, "fork": null, "fork_count": 98, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17775087, "size": 18681, "stargazer_count": 35, "stars": null, "updates": null, "url": "https://github.com/wso2/cdmf-agent-android" }
17775087_10
{ "fields": [ { "declarator": "mMockRequest", "modifier": "@Mock private", "original_string": "@Mock private Request<String> mMockRequest;", "type": "Request<String>", "var_name": "mMockRequest" }, { "declarator": "mMockRetryPolicy", "modifier": "@Mock private", ...
{ "body": "@Test public void serverError_enableRetries() throws Exception {\n for (int i = 500; i <= 599; i++) {\n MockHttpStack mockHttpStack = new MockHttpStack();\n BasicHttpResponse fakeResponse =\n new BasicHttpResponse(new ProtocolVersion(\"HTTP\", 1, 1), i, \"\")...
{ "fields": [ { "declarator": "DEBUG = VolleyLog.DEBUG", "modifier": "protected static final", "original_string": "protected static final boolean DEBUG = VolleyLog.DEBUG;", "type": "boolean", "var_name": "DEBUG" }, { "declarator": "SLOW_REQUEST_THRESHOLD_MS = 3000", ...
{ "body": "@Override\n public NetworkResponse performRequest(Request<?> request) throws VolleyError {\n long requestStart = SystemClock.elapsedRealtime();\n while (true) {\n HttpResponse httpResponse = null;\n byte[] responseContents = null;\n Map<String, String> resp...
{ "created": null, "fork": null, "fork_count": 98, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17775087, "size": 18681, "stargazer_count": 35, "stars": null, "updates": null, "url": "https://github.com/wso2/cdmf-agent-android" }
17775087_6
{ "fields": [ { "declarator": "mMockRequest", "modifier": "@Mock private", "original_string": "@Mock private Request<String> mMockRequest;", "type": "Request<String>", "var_name": "mMockRequest" }, { "declarator": "mMockRetryPolicy", "modifier": "@Mock private", ...
{ "body": "@Test public void unauthorized() throws Exception {\n MockHttpStack mockHttpStack = new MockHttpStack();\n BasicHttpResponse fakeResponse = new BasicHttpResponse(new ProtocolVersion(\"HTTP\", 1, 1),\n 401, \"Unauthorized\");\n mockHttpStack.setResponseToReturn(fakeRespon...
{ "fields": [ { "declarator": "DEBUG = VolleyLog.DEBUG", "modifier": "protected static final", "original_string": "protected static final boolean DEBUG = VolleyLog.DEBUG;", "type": "boolean", "var_name": "DEBUG" }, { "declarator": "SLOW_REQUEST_THRESHOLD_MS = 3000", ...
{ "body": "@Override\n public NetworkResponse performRequest(Request<?> request) throws VolleyError {\n long requestStart = SystemClock.elapsedRealtime();\n while (true) {\n HttpResponse httpResponse = null;\n byte[] responseContents = null;\n Map<String, String> resp...
{ "created": null, "fork": null, "fork_count": 98, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17775087, "size": 18681, "stargazer_count": 35, "stars": null, "updates": null, "url": "https://github.com/wso2/cdmf-agent-android" }
17775087_40
{ "fields": [ { "declarator": "mAccountManager", "modifier": "private", "original_string": "private AccountManager mAccountManager;", "type": "AccountManager", "var_name": "mAccountManager" }, { "declarator": "mAccount", "modifier": "private", "original_stri...
{ "body": "@Test(expected = AuthFailureError.class)\n public void failedGetAuthToken() throws Exception {\n when(mAccountManager.getAuthToken(mAccount, \"cooltype\", false, null, null)).thenReturn(mFuture);\n when(mFuture.getResult()).thenThrow(new AuthenticatorException(\"sadness!\"));\n mAut...
{ "fields": [ { "declarator": "mAccountManager", "modifier": "private final", "original_string": "private final AccountManager mAccountManager;", "type": "AccountManager", "var_name": "mAccountManager" }, { "declarator": "mAccount", "modifier": "private final", ...
{ "body": "@SuppressWarnings(\"deprecation\")\n @Override\n public String getAuthToken() throws AuthFailureError {\n AccountManagerFuture<Bundle> future = mAccountManager.getAuthToken(mAccount,\n mAuthTokenType, mNotifyAuthFailure, null, null);\n Bundle result;\n try {\n ...
{ "created": null, "fork": null, "fork_count": 98, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17775087, "size": 18681, "stargazer_count": 35, "stars": null, "updates": null, "url": "https://github.com/wso2/cdmf-agent-android" }
17775087_41
{ "fields": [ { "declarator": "mAccountManager", "modifier": "private", "original_string": "private AccountManager mAccountManager;", "type": "AccountManager", "var_name": "mAccountManager" }, { "declarator": "mAccount", "modifier": "private", "original_stri...
{ "body": "@Test(expected = AuthFailureError.class)\n public void resultContainsIntent() throws Exception {\n Intent intent = new Intent();\n Bundle bundle = new Bundle();\n bundle.putParcelable(AccountManager.KEY_INTENT, intent);\n when(mAccountManager.getAuthToken(mAccount, \"cooltype...
{ "fields": [ { "declarator": "mAccountManager", "modifier": "private final", "original_string": "private final AccountManager mAccountManager;", "type": "AccountManager", "var_name": "mAccountManager" }, { "declarator": "mAccount", "modifier": "private final", ...
{ "body": "@SuppressWarnings(\"deprecation\")\n @Override\n public String getAuthToken() throws AuthFailureError {\n AccountManagerFuture<Bundle> future = mAccountManager.getAuthToken(mAccount,\n mAuthTokenType, mNotifyAuthFailure, null, null);\n Bundle result;\n try {\n ...
{ "created": null, "fork": null, "fork_count": 98, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17775087, "size": 18681, "stargazer_count": 35, "stars": null, "updates": null, "url": "https://github.com/wso2/cdmf-agent-android" }
17775087_7
{ "fields": [ { "declarator": "mMockRequest", "modifier": "@Mock private", "original_string": "@Mock private Request<String> mMockRequest;", "type": "Request<String>", "var_name": "mMockRequest" }, { "declarator": "mMockRetryPolicy", "modifier": "@Mock private", ...
{ "body": "@Test public void forbidden() throws Exception {\n MockHttpStack mockHttpStack = new MockHttpStack();\n BasicHttpResponse fakeResponse = new BasicHttpResponse(new ProtocolVersion(\"HTTP\", 1, 1),\n 403, \"Forbidden\");\n mockHttpStack.setResponseToReturn(fakeResponse);\n...
{ "fields": [ { "declarator": "DEBUG = VolleyLog.DEBUG", "modifier": "protected static final", "original_string": "protected static final boolean DEBUG = VolleyLog.DEBUG;", "type": "boolean", "var_name": "DEBUG" }, { "declarator": "SLOW_REQUEST_THRESHOLD_MS = 3000", ...
{ "body": "@Override\n public NetworkResponse performRequest(Request<?> request) throws VolleyError {\n long requestStart = SystemClock.elapsedRealtime();\n while (true) {\n HttpResponse httpResponse = null;\n byte[] responseContents = null;\n Map<String, String> resp...
{ "created": null, "fork": null, "fork_count": 98, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17775087, "size": 18681, "stargazer_count": 35, "stars": null, "updates": null, "url": "https://github.com/wso2/cdmf-agent-android" }
17775087_8
{ "fields": [ { "declarator": "mMockRequest", "modifier": "@Mock private", "original_string": "@Mock private Request<String> mMockRequest;", "type": "Request<String>", "var_name": "mMockRequest" }, { "declarator": "mMockRetryPolicy", "modifier": "@Mock private", ...
{ "body": "@Test public void redirect() throws Exception {\n for (int i = 300; i <= 399; i++) {\n MockHttpStack mockHttpStack = new MockHttpStack();\n BasicHttpResponse fakeResponse =\n new BasicHttpResponse(new ProtocolVersion(\"HTTP\", 1, 1), i, \"\");\n mo...
{ "fields": [ { "declarator": "DEBUG = VolleyLog.DEBUG", "modifier": "protected static final", "original_string": "protected static final boolean DEBUG = VolleyLog.DEBUG;", "type": "boolean", "var_name": "DEBUG" }, { "declarator": "SLOW_REQUEST_THRESHOLD_MS = 3000", ...
{ "body": "@Override\n public NetworkResponse performRequest(Request<?> request) throws VolleyError {\n long requestStart = SystemClock.elapsedRealtime();\n while (true) {\n HttpResponse httpResponse = null;\n byte[] responseContents = null;\n Map<String, String> resp...
{ "created": null, "fork": null, "fork_count": 98, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17775087, "size": 18681, "stargazer_count": 35, "stars": null, "updates": null, "url": "https://github.com/wso2/cdmf-agent-android" }
17775087_39
{ "fields": [], "file": "app-catalog/volley/src/test/java/com/android/volley/toolbox/ImageRequestTest.java", "identifier": "ImageRequestTest", "interfaces": "", "superclass": "" }
{ "body": "@Test public void findBestSampleSize() {\n // desired == actual == 1\n assertEquals(1, ImageRequest.findBestSampleSize(100, 150, 100, 150));\n\n // exactly half == 2\n assertEquals(2, ImageRequest.findBestSampleSize(280, 160, 140, 80));\n\n // just over half == 1\n ...
{ "fields": [ { "declarator": "DEFAULT_IMAGE_TIMEOUT_MS = 1000", "modifier": "public static final", "original_string": "public static final int DEFAULT_IMAGE_TIMEOUT_MS = 1000;", "type": "int", "var_name": "DEFAULT_IMAGE_TIMEOUT_MS" }, { "declarator": "DEFAULT_IMAGE_MAX...
{ "body": "static int findBestSampleSize(\n int actualWidth, int actualHeight, int desiredWidth, int desiredHeight) {\n double wr = (double) actualWidth / desiredWidth;\n double hr = (double) actualHeight / desiredHeight;\n double ratio = Math.min(wr, hr);\n float n = 1.0f;\n ...
{ "created": null, "fork": null, "fork_count": 98, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17775087, "size": 18681, "stargazer_count": 35, "stars": null, "updates": null, "url": "https://github.com/wso2/cdmf-agent-android" }
17775087_42
{ "fields": [ { "declarator": "mAccountManager", "modifier": "private", "original_string": "private AccountManager mAccountManager;", "type": "AccountManager", "var_name": "mAccountManager" }, { "declarator": "mAccount", "modifier": "private", "original_stri...
{ "body": "@Test(expected = AuthFailureError.class)\n public void missingAuthToken() throws Exception {\n Bundle bundle = new Bundle();\n when(mAccountManager.getAuthToken(mAccount, \"cooltype\", false, null, null)).thenReturn(mFuture);\n when(mFuture.getResult()).thenReturn(bundle);\n ...
{ "fields": [ { "declarator": "mAccountManager", "modifier": "private final", "original_string": "private final AccountManager mAccountManager;", "type": "AccountManager", "var_name": "mAccountManager" }, { "declarator": "mAccount", "modifier": "private final", ...
{ "body": "@SuppressWarnings(\"deprecation\")\n @Override\n public String getAuthToken() throws AuthFailureError {\n AccountManagerFuture<Bundle> future = mAccountManager.getAuthToken(mAccount,\n mAuthTokenType, mNotifyAuthFailure, null, null);\n Bundle result;\n try {\n ...
{ "created": null, "fork": null, "fork_count": 98, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17775087, "size": 18681, "stargazer_count": 35, "stars": null, "updates": null, "url": "https://github.com/wso2/cdmf-agent-android" }
17775087_4
{ "fields": [ { "declarator": "mMockRequest", "modifier": "@Mock private", "original_string": "@Mock private Request<String> mMockRequest;", "type": "Request<String>", "var_name": "mMockRequest" }, { "declarator": "mMockRetryPolicy", "modifier": "@Mock private", ...
{ "body": "@Test public void connectTimeout() throws Exception {\n MockHttpStack mockHttpStack = new MockHttpStack();\n mockHttpStack.setExceptionToThrow(new ConnectTimeoutException());\n BasicNetwork httpNetwork = new BasicNetwork(mockHttpStack);\n Request<String> request = buildRequest()...
{ "fields": [ { "declarator": "DEBUG = VolleyLog.DEBUG", "modifier": "protected static final", "original_string": "protected static final boolean DEBUG = VolleyLog.DEBUG;", "type": "boolean", "var_name": "DEBUG" }, { "declarator": "SLOW_REQUEST_THRESHOLD_MS = 3000", ...
{ "body": "@Override\n public NetworkResponse performRequest(Request<?> request) throws VolleyError {\n long requestStart = SystemClock.elapsedRealtime();\n while (true) {\n HttpResponse httpResponse = null;\n byte[] responseContents = null;\n Map<String, String> resp...
{ "created": null, "fork": null, "fork_count": 98, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17775087, "size": 18681, "stargazer_count": 35, "stars": null, "updates": null, "url": "https://github.com/wso2/cdmf-agent-android" }
17775087_5
{ "fields": [ { "declarator": "mMockRequest", "modifier": "@Mock private", "original_string": "@Mock private Request<String> mMockRequest;", "type": "Request<String>", "var_name": "mMockRequest" }, { "declarator": "mMockRetryPolicy", "modifier": "@Mock private", ...
{ "body": "@Test public void noConnection() throws Exception {\n MockHttpStack mockHttpStack = new MockHttpStack();\n mockHttpStack.setExceptionToThrow(new IOException());\n BasicNetwork httpNetwork = new BasicNetwork(mockHttpStack);\n Request<String> request = buildRequest();\n req...
{ "fields": [ { "declarator": "DEBUG = VolleyLog.DEBUG", "modifier": "protected static final", "original_string": "protected static final boolean DEBUG = VolleyLog.DEBUG;", "type": "boolean", "var_name": "DEBUG" }, { "declarator": "SLOW_REQUEST_THRESHOLD_MS = 3000", ...
{ "body": "@Override\n public NetworkResponse performRequest(Request<?> request) throws VolleyError {\n long requestStart = SystemClock.elapsedRealtime();\n while (true) {\n HttpResponse httpResponse = null;\n byte[] responseContents = null;\n Map<String, String> resp...
{ "created": null, "fork": null, "fork_count": 98, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17775087, "size": 18681, "stargazer_count": 35, "stars": null, "updates": null, "url": "https://github.com/wso2/cdmf-agent-android" }
17775087_43
{ "fields": [ { "declarator": "mAccountManager", "modifier": "private", "original_string": "private AccountManager mAccountManager;", "type": "AccountManager", "var_name": "mAccountManager" }, { "declarator": "mAccount", "modifier": "private", "original_stri...
{ "body": "@Test\n public void invalidateAuthToken() throws Exception {\n mAuthenticator.invalidateAuthToken(\"monkey\");\n verify(mAccountManager).invalidateAuthToken(\"cooltype\", \"monkey\");\n }", "class_method_signature": "AndroidAuthenticatorTest.invalidateAuthToken()", "constructor": fa...
{ "fields": [ { "declarator": "mAccountManager", "modifier": "private final", "original_string": "private final AccountManager mAccountManager;", "type": "AccountManager", "var_name": "mAccountManager" }, { "declarator": "mAccount", "modifier": "private final", ...
{ "body": "@Override\n public void invalidateAuthToken(String authToken) {\n mAccountManager.invalidateAuthToken(mAccount.type, authToken);\n }", "class_method_signature": "AndroidAuthenticator.invalidateAuthToken(String authToken)", "constructor": false, "full_signature": "@Override public void in...
{ "created": null, "fork": null, "fork_count": 98, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17775087, "size": 18681, "stargazer_count": 35, "stars": null, "updates": null, "url": "https://github.com/wso2/cdmf-agent-android" }
17775087_9
{ "fields": [ { "declarator": "mMockRequest", "modifier": "@Mock private", "original_string": "@Mock private Request<String> mMockRequest;", "type": "Request<String>", "var_name": "mMockRequest" }, { "declarator": "mMockRetryPolicy", "modifier": "@Mock private", ...
{ "body": "@Test public void otherClientError() throws Exception {\n for (int i = 400; i <= 499; i++) {\n if (i == 401 || i == 403) {\n // covered above.\n continue;\n }\n MockHttpStack mockHttpStack = new MockHttpStack();\n BasicHttpRes...
{ "fields": [ { "declarator": "DEBUG = VolleyLog.DEBUG", "modifier": "protected static final", "original_string": "protected static final boolean DEBUG = VolleyLog.DEBUG;", "type": "boolean", "var_name": "DEBUG" }, { "declarator": "SLOW_REQUEST_THRESHOLD_MS = 3000", ...
{ "body": "@Override\n public NetworkResponse performRequest(Request<?> request) throws VolleyError {\n long requestStart = SystemClock.elapsedRealtime();\n while (true) {\n HttpResponse httpResponse = null;\n byte[] responseContents = null;\n Map<String, String> resp...
{ "created": null, "fork": null, "fork_count": 98, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17775087, "size": 18681, "stargazer_count": 35, "stars": null, "updates": null, "url": "https://github.com/wso2/cdmf-agent-android" }
17775087_44
{ "fields": [ { "declarator": "mAccountManager", "modifier": "private", "original_string": "private AccountManager mAccountManager;", "type": "AccountManager", "var_name": "mAccountManager" }, { "declarator": "mAccount", "modifier": "private", "original_stri...
{ "body": "@Test\n public void goodToken() throws Exception {\n Bundle bundle = new Bundle();\n bundle.putString(AccountManager.KEY_AUTHTOKEN, \"monkey\");\n when(mAccountManager.getAuthToken(mAccount, \"cooltype\", false, null, null)).thenReturn(mFuture);\n when(mFuture.getResult()).th...
{ "fields": [ { "declarator": "mAccountManager", "modifier": "private final", "original_string": "private final AccountManager mAccountManager;", "type": "AccountManager", "var_name": "mAccountManager" }, { "declarator": "mAccount", "modifier": "private final", ...
{ "body": "@SuppressWarnings(\"deprecation\")\n @Override\n public String getAuthToken() throws AuthFailureError {\n AccountManagerFuture<Bundle> future = mAccountManager.getAuthToken(mAccount,\n mAuthTokenType, mNotifyAuthFailure, null, null);\n Bundle result;\n try {\n ...
{ "created": null, "fork": null, "fork_count": 98, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17775087, "size": 18681, "stargazer_count": 35, "stars": null, "updates": null, "url": "https://github.com/wso2/cdmf-agent-android" }
17775087_2
{ "fields": [ { "declarator": "mMockRequest", "modifier": "@Mock private", "original_string": "@Mock private Request<String> mMockRequest;", "type": "Request<String>", "var_name": "mMockRequest" }, { "declarator": "mMockRetryPolicy", "modifier": "@Mock private", ...
{ "body": "@Test public void headersAndPostParams() throws Exception {\n MockHttpStack mockHttpStack = new MockHttpStack();\n BasicHttpResponse fakeResponse = new BasicHttpResponse(new ProtocolVersion(\"HTTP\", 1, 1),\n 200, \"OK\");\n fakeResponse.setEntity(new StringEntity(\"foob...
{ "fields": [ { "declarator": "DEBUG = VolleyLog.DEBUG", "modifier": "protected static final", "original_string": "protected static final boolean DEBUG = VolleyLog.DEBUG;", "type": "boolean", "var_name": "DEBUG" }, { "declarator": "SLOW_REQUEST_THRESHOLD_MS = 3000", ...
{ "body": "@Override\n public NetworkResponse performRequest(Request<?> request) throws VolleyError {\n long requestStart = SystemClock.elapsedRealtime();\n while (true) {\n HttpResponse httpResponse = null;\n byte[] responseContents = null;\n Map<String, String> resp...
{ "created": null, "fork": null, "fork_count": 98, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17775087, "size": 18681, "stargazer_count": 35, "stars": null, "updates": null, "url": "https://github.com/wso2/cdmf-agent-android" }
17775087_3
{ "fields": [ { "declarator": "mMockRequest", "modifier": "@Mock private", "original_string": "@Mock private Request<String> mMockRequest;", "type": "Request<String>", "var_name": "mMockRequest" }, { "declarator": "mMockRetryPolicy", "modifier": "@Mock private", ...
{ "body": "@Test public void socketTimeout() throws Exception {\n MockHttpStack mockHttpStack = new MockHttpStack();\n mockHttpStack.setExceptionToThrow(new SocketTimeoutException());\n BasicNetwork httpNetwork = new BasicNetwork(mockHttpStack);\n Request<String> request = buildRequest();\...
{ "fields": [ { "declarator": "DEBUG = VolleyLog.DEBUG", "modifier": "protected static final", "original_string": "protected static final boolean DEBUG = VolleyLog.DEBUG;", "type": "boolean", "var_name": "DEBUG" }, { "declarator": "SLOW_REQUEST_THRESHOLD_MS = 3000", ...
{ "body": "@Override\n public NetworkResponse performRequest(Request<?> request) throws VolleyError {\n long requestStart = SystemClock.elapsedRealtime();\n while (true) {\n HttpResponse httpResponse = null;\n byte[] responseContents = null;\n Map<String, String> resp...
{ "created": null, "fork": null, "fork_count": 98, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17775087, "size": 18681, "stargazer_count": 35, "stars": null, "updates": null, "url": "https://github.com/wso2/cdmf-agent-android" }
17775087_45
{ "fields": [ { "declarator": "mAccountManager", "modifier": "private", "original_string": "private AccountManager mAccountManager;", "type": "AccountManager", "var_name": "mAccountManager" }, { "declarator": "mAccount", "modifier": "private", "original_stri...
{ "body": "@Test\n public void publicMethods() throws Exception {\n // Catch-all test to find API-breaking changes.\n Context context = mock(Context.class);\n new AndroidAuthenticator(context, mAccount, \"cooltype\");\n new AndroidAuthenticator(context, mAccount, \"cooltype\", true);\n ...
{ "fields": [ { "declarator": "mAccountManager", "modifier": "private final", "original_string": "private final AccountManager mAccountManager;", "type": "AccountManager", "var_name": "mAccountManager" }, { "declarator": "mAccount", "modifier": "private final", ...
{ "body": "public Account getAccount() {\n return mAccount;\n }", "class_method_signature": "AndroidAuthenticator.getAccount()", "constructor": false, "full_signature": "public Account getAccount()", "identifier": "getAccount", "invocations": [], "modifiers": "public", "parameters": "()", "r...
{ "created": null, "fork": null, "fork_count": 98, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17775087, "size": 18681, "stargazer_count": 35, "stars": null, "updates": null, "url": "https://github.com/wso2/cdmf-agent-android" }
128393918_134
{ "fields": [], "file": "keanu-project/src/test/java/io/improbable/keanu/vertices/tensor/number/floating/dbl/nonprobabilistic/diff/LogProbGradientCalculatorTest.java", "identifier": "LogProbGradientCalculatorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void doesMatchReverseAutoDiffWithManyOps() {\n long[] shape = new long[]{2, 2};\n DoubleVertex A = new GaussianVertex(shape, 0, 1);\n A.setValue(DoubleTensor.linspace(0.1, 2, 4).reshape(shape));\n DoubleVertex B = new GaussianVertex(shape, 0, 1);\n B.set...
{ "fields": [ { "declarator": "logProbOfVertices", "modifier": "private final", "original_string": "private final Set<Vertex> logProbOfVertices;", "type": "Set<Vertex>", "var_name": "logProbOfVertices" }, { "declarator": "wrtVertices", "modifier": "private final",...
{ "body": "public Map<VertexId, DoubleTensor> getJointLogProbGradientWrtLatents() {\n LogProbGradients totalLogProbGradients = new LogProbGradients();\n\n for (final Vertex<?, ?> ofVertex : logProbOfVertices) {\n LogProbGradients logProbGradientOfVertex = reverseModeLogProbGradientWrtLatents(...
{ "created": null, "fork": null, "fork_count": 33, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 128393918, "size": 15461, "stargazer_count": 146, "stars": null, "updates": null, "url": "https://github.com/improbable-research/keanu" }
128393918_358
{ "fields": [ { "declarator": "thrown = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException thrown = ExpectedException.none();", "type": "ExpectedException", "var_name": "thrown" }, { "declarator": "testFol...
{ "body": "@Test\n public void canCreateTemplate() {\n TemplateProcessor.getFileTemplate(TEST_TEMPLATE_FILE);\n }", "class_method_signature": "TemplateProcessorTest.canCreateTemplate()", "constructor": false, "full_signature": "@Test public void canCreateTemplate()", "identifier": "canCreateTempl...
{ "fields": [], "file": "codegen/src/main/java/io/improbable/keanu/codegen/python/TemplateProcessor.java", "identifier": "TemplateProcessor", "interfaces": "", "methods": [ { "class_method_signature": "TemplateProcessor.processDataModel(Map<String, Object> dataModel, Template fileTemplate, Writer fi...
{ "body": "public Template getFileTemplate(String templateFile) {\n Configuration cfg = new Configuration(Configuration.VERSION_2_3_28);\n cfg.setClassForTemplateLoading(Runner.class, \"/\");\n try {\n return cfg.getTemplate(templateFile);\n } catch (IOException e) {\n ...
{ "created": null, "fork": null, "fork_count": 33, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 128393918, "size": 15461, "stargazer_count": 146, "stars": null, "updates": null, "url": "https://github.com/improbable-research/keanu" }
128393918_163
{ "fields": [ { "declarator": "DELTA = 0.0001", "modifier": "private static final", "original_string": "private static final double DELTA = 0.0001;", "type": "double", "var_name": "DELTA" }, { "declarator": "random", "modifier": "private", "original_string":...
{ "body": "@Test\n public void logProbGraphMatchesKnownLogDensityOfVector() {\n DoubleVertex sigma = ConstantVertex.of(1., 1.);\n HalfGaussianVertex halfGaussianVertex = new HalfGaussianVertex(sigma);\n LogProbGraph logProbGraph = halfGaussianVertex.logProbGraph();\n LogProbGraphValueFe...
{ "fields": [ { "declarator": "MU_ZERO = 0.0", "modifier": "private static final", "original_string": "private static final double MU_ZERO = 0.0;", "type": "double", "var_name": "MU_ZERO" }, { "declarator": "LOG_TWO = Math.log(2)", "modifier": "private static fina...
{ "body": "@Override\n public LogProbGraph logProbGraph() {\n final DoublePlaceholderVertex xPlaceholder = new DoublePlaceholderVertex(this.getShape());\n final DoublePlaceholderVertex muPlaceholder = new DoublePlaceholderVertex(getMu().getShape());\n final DoublePlaceholderVertex sigmaPlaceho...
{ "created": null, "fork": null, "fork_count": 33, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 128393918, "size": 15461, "stargazer_count": 146, "stars": null, "updates": null, "url": "https://github.com/improbable-research/keanu" }
128393918_175
{ "fields": [ { "declarator": "VERTEX_INCREMENT = 0.1", "modifier": "private final", "original_string": "private final double VERTEX_INCREMENT = 0.1;", "type": "double", "var_name": "VERTEX_INCREMENT" }, { "declarator": "random", "modifier": "private", "orig...
{ "body": "@Test\n public void logProbGraphIsNegInfIfLocationAndScaleIsNotPositive() {\n DoubleVertex location = ConstantVertex.of(-1., 1.);\n DoubleVertex scale = ConstantVertex.of(0., 3.);\n ParetoVertex paretoVertex = new ParetoVertex(location, scale);\n LogProbGraph logProbGraph = p...
{ "fields": [ { "declarator": "scale", "modifier": "private final", "original_string": "private final DoubleVertex scale;", "type": "DoubleVertex", "var_name": "scale" }, { "declarator": "location", "modifier": "private final", "original_string": "private fi...
{ "body": "@Override\n public LogProbGraph logProbGraph() {\n final DoublePlaceholderVertex xPlaceholder = new DoublePlaceholderVertex(this.getShape());\n final DoublePlaceholderVertex locationPlaceholder = new DoublePlaceholderVertex(location.getShape());\n final DoublePlaceholderVertex scale...
{ "created": null, "fork": null, "fork_count": 33, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 128393918, "size": 15461, "stargazer_count": 146, "stars": null, "updates": null, "url": "https://github.com/improbable-research/keanu" }
128393918_319
{ "fields": [ { "declarator": "thrown = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException thrown = ExpectedException.none();", "type": "ExpectedException", "var_name": "thrown" }, { "declarator": "qDist",...
{ "body": "@Test\n public void returnsLargerKLDivergenceIfTheLocationOfQIsFurtherFromP_QIsQDistribution() {\n GaussianVertex v1 = new GaussianVertex(0., 1.);\n ConstantDoubleVertex v2 = new ConstantDoubleVertex(0.1);\n DoubleVertex v3 = v1.plus(v2);\n\n KeanuProbabilisticModel model = n...
{ "fields": [], "file": "keanu-project/src/main/java/io/improbable/keanu/algorithms/variational/KLDivergence.java", "identifier": "KLDivergence", "interfaces": "", "methods": [ { "class_method_signature": "KLDivergence.compute(QDistribution q, NetworkSamples p)", "constructor": false, "f...
{ "body": "public static double compute(QDistribution q, NetworkSamples p) {\n return compute(p, q::getLogOfMasterP);\n }", "class_method_signature": "KLDivergence.compute(QDistribution q, NetworkSamples p)", "constructor": false, "full_signature": "public static double compute(QDistribution q, Networ...
{ "created": null, "fork": null, "fork_count": 33, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 128393918, "size": 15461, "stargazer_count": 146, "stars": null, "updates": null, "url": "https://github.com/improbable-research/keanu" }
128393918_122
{ "fields": [ { "declarator": "epsilon = 0.01", "modifier": "private static", "original_string": "private static double epsilon = 0.01;", "type": "double", "var_name": "epsilon" }, { "declarator": "N = 100000", "modifier": "private static", "original_string"...
{ "body": "@Category(Slow.class)\n @Test\n public void fourValuesNotEquallyWeightedSummingToOne() {\n\n Map<TestEnum, DoubleVertex> selectableValues = new LinkedHashMap<>();\n selectableValues.put(TestEnum.A, ConstantVertex.of(0.1));\n selectableValues.put(TestEnum.B, ConstantVertex.of(0.2)...
{ "fields": [ { "declarator": "selectableValues", "modifier": "private final", "original_string": "private final Map<CATEGORY, DoubleVertex> selectableValues;", "type": "Map<CATEGORY, DoubleVertex>", "var_name": "selectableValues" } ], "file": "keanu-project/src/main/java/io/...
{ "body": "public static <CATEGORY> CategoricalVertex<CATEGORY> of(\n Map<CATEGORY, Double> selectableValues\n ) {\n return new CategoricalVertex<>(toDoubleVertices(selectableValues));\n }", "class_method_signature": "CategoricalVertex.of(\n Map<CATEGORY, Double> selectableValues\n )",...
{ "created": null, "fork": null, "fork_count": 33, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 128393918, "size": 15461, "stargazer_count": 146, "stars": null, "updates": null, "url": "https://github.com/improbable-research/keanu" }
128393918_159
{ "fields": [ { "declarator": "DELTA = 0.0001", "modifier": "private static final", "original_string": "private static final double DELTA = 0.0001;", "type": "double", "var_name": "DELTA" }, { "declarator": "random", "modifier": "private", "original_string":...
{ "body": "@Test\n public void logProbGraphMatchesKnownLogDensityOfScalar() {\n DoubleVertex mu = ConstantVertex.of(0.);\n DoubleVertex sigma = ConstantVertex.of(1.);\n LogNormalVertex logNormalVertex = new LogNormalVertex(mu, sigma);\n LogProbGraph logProbGraph = logNormalVertex.logPro...
{ "fields": [ { "declarator": "mu", "modifier": "private final", "original_string": "private final DoubleVertex mu;", "type": "DoubleVertex", "var_name": "mu" }, { "declarator": "sigma", "modifier": "private final", "original_string": "private final DoubleVe...
{ "body": "@Override\n public LogProbGraph logProbGraph() {\n final DoublePlaceholderVertex xPlaceholder = new DoublePlaceholderVertex(this.getShape());\n final DoublePlaceholderVertex muPlaceholder = new DoublePlaceholderVertex(mu.getShape());\n final DoublePlaceholderVertex sigmaPlaceholder ...
{ "created": null, "fork": null, "fork_count": 33, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 128393918, "size": 15461, "stargazer_count": 146, "stars": null, "updates": null, "url": "https://github.com/improbable-research/keanu" }
128393918_270
{ "fields": [ { "declarator": "AReference", "modifier": "private", "original_string": "private VariableReference AReference;", "type": "VariableReference", "var_name": "AReference" }, { "declarator": "BReference", "modifier": "private", "original_string": "p...
{ "body": "@Test\n public void canTimesAMapOfValues() {\n\n Map<VariableReference, DoubleTensor> result = VariableValues.times(left, 2);\n\n DoubleTensor expectedA = DoubleTensor.create(2, 4);\n DoubleTensor expectedB = DoubleTensor.create(6, 8);\n\n assertEquals(expectedA, result.get(A...
{ "fields": [], "file": "keanu-project/src/main/java/io/improbable/keanu/algorithms/mcmc/nuts/VariableValues.java", "identifier": "VariableValues", "interfaces": "", "methods": [ { "class_method_signature": "VariableValues.VariableValues()", "constructor": true, "full_signature": "privat...
{ "body": "public static Map<VariableReference, DoubleTensor> times(Map<VariableReference, DoubleTensor> left, double right) {\n Map<VariableReference, DoubleTensor> result = new HashMap<>();\n for (VariableReference v : left.keySet()) {\n result.put(v, left.get(v).times(right));\n }\n...
{ "created": null, "fork": null, "fork_count": 33, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 128393918, "size": 15461, "stargazer_count": 146, "stars": null, "updates": null, "url": "https://github.com/improbable-research/keanu" }
128393918_21
{ "fields": [ { "declarator": "scalar1 = new long[0]", "modifier": "private", "original_string": "private long[] scalar1 = new long[0];", "type": "long[]", "var_name": "scalar1" }, { "declarator": "scalar2 = new long[0]", "modifier": "private", "original_str...
{ "body": "@Test(expected = IllegalArgumentException.class)\n public void rejectsShapeNotMatchingParent() {\n TensorShapeValidation.checkTensorsMatchNonLengthOneShapeOrAreLengthOne(new long[]{2, 4}, twoByTwo1, scalar1);\n }", "class_method_signature": "TensorShapeValidationTest.rejectsShapeNotMatchingP...
{ "fields": [], "file": "keanu-project/src/main/java/io/improbable/keanu/tensor/TensorShapeValidation.java", "identifier": "TensorShapeValidation", "interfaces": "", "methods": [ { "class_method_signature": "TensorShapeValidation.TensorShapeValidation()", "constructor": true, "full_signa...
{ "body": "public static void checkTensorsMatchNonLengthOneShapeOrAreLengthOne(long[] proposalShape, long[]... shapes) {\n\n Set<TensorShape> nonLengthOneShapes = getNonLengthOneShapes(shapes);\n\n if (!nonLengthOneShapes.isEmpty()) {\n\n boolean moreThanOneNonLengthOneShape = nonLengthOneSha...
{ "created": null, "fork": null, "fork_count": 33, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 128393918, "size": 15461, "stargazer_count": 146, "stars": null, "updates": null, "url": "https://github.com/improbable-research/keanu" }
128393918_335
{ "fields": [ { "declarator": "ROWS = Arrays.asList(\n new Bean(0),\n new Bean(0),\n new Bean(0)\n )", "modifier": "private static final", "original_string": "private static final List<Bean> ROWS = Arrays.asList(\n new Bean(0),\n new Bean(0),\n new Be...
{ "body": "@Test\n public void buildSequenceFromCount_Size() {\n int n = 100;\n Sequence sequence = new SequenceBuilder()\n .count(n)\n .withFactory(item -> {\n })\n .build();\n assertEquals(n, sequence.size());\n }", "class_method_signature": "...
{ "fields": [ { "declarator": "PROXY_LABEL_MARKER = \"proxy_for\"", "modifier": "private static final", "original_string": "private static final String PROXY_LABEL_MARKER = \"proxy_for\";", "type": "String", "var_name": "PROXY_LABEL_MARKER" }, { "declarator": "initialSt...
{ "body": "public FromCount count(int count) {\n return new FromCount(count, initialState);\n }", "class_method_signature": "SequenceBuilder.count(int count)", "constructor": false, "full_signature": "public FromCount count(int count)", "identifier": "count", "invocations": [], "modifiers": "pub...
{ "created": null, "fork": null, "fork_count": 33, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 128393918, "size": 15461, "stargazer_count": 146, "stars": null, "updates": null, "url": "https://github.com/improbable-research/keanu" }
128393918_76
{ "fields": [ { "declarator": "samples", "modifier": "private", "original_string": "private NetworkSamples samples;", "type": "NetworkSamples", "var_name": "samples" }, { "declarator": "rowTensors = new ArrayList<>()", "modifier": "private", "original_string...
{ "body": "@Test\n public void writeRowOfScalarsToCsvWithCustomHeader() throws IOException {\n String[] customHeader = new String[]{\"Temperature\", \"Humidity\"};\n File file = WriteCsv.asColumns(scalarTensors).withHeader(customHeader).toFile(File.createTempFile(\"test\", \".csv\"));\n\n CsvR...
{ "fields": [], "file": "keanu-project/src/main/java/io/improbable/keanu/util/csv/WriteCsv.java", "identifier": "WriteCsv", "interfaces": "", "methods": [ { "class_method_signature": "WriteCsv.asSamples(NetworkSamples samples, List<? extends Vertex<? extends Tensor, ?>> vertices)", "constructo...
{ "body": "public static ColumnWriter asColumns(List<? extends Vertex<? extends Tensor, ?>> vertices) {\n return new ColumnWriter(vertices);\n }", "class_method_signature": "WriteCsv.asColumns(List<? extends Vertex<? extends Tensor, ?>> vertices)", "constructor": false, "full_signature": "public stati...
{ "created": null, "fork": null, "fork_count": 33, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 128393918, "size": 15461, "stargazer_count": 146, "stars": null, "updates": null, "url": "https://github.com/improbable-research/keanu" }
128393918_227
{ "fields": [ { "declarator": "expectedException = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException expectedException = ExpectedException.none();", "type": "ExpectedException", "var_name": "expectedException" } ...
{ "body": "@Test\n public void byDefaultALabelHasNoNamespace() {\n VertexLabel foo = new VertexLabel(\"foo\");\n assertThat(foo.toString(), equalTo(\"foo\"));\n }", "class_method_signature": "VertexLabelTest.byDefaultALabelHasNoNamespace()", "constructor": false, "full_signature": "@Test pub...
{ "fields": [ { "declarator": "NAMESPACE_SEPARATOR = '.'", "modifier": "private static final", "original_string": "private static final char NAMESPACE_SEPARATOR = '.';", "type": "char", "var_name": "NAMESPACE_SEPARATOR" }, { "declarator": "namespace", "modifier": ...
{ "body": "@Override\n public String toString() {\n return getQualifiedName();\n }", "class_method_signature": "VertexLabel.toString()", "constructor": false, "full_signature": "@Override public String toString()", "identifier": "toString", "invocations": [ "getQualifiedName" ], "modifi...
{ "created": null, "fork": null, "fork_count": 33, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 128393918, "size": 15461, "stargazer_count": 146, "stars": null, "updates": null, "url": "https://github.com/improbable-research/keanu" }
128393918_99
{ "fields": [ { "declarator": "Amu", "modifier": "", "original_string": "DoubleVertex Amu;", "type": "DoubleVertex", "var_name": "Amu" }, { "declarator": "Asigma", "modifier": "", "original_string": "DoubleVertex Asigma;", "type": "DoubleVertex", ...
{ "body": "@Test\n public void doesGetAllDownstreamVertices() {\n TransitiveClosure transitiveClosure = TransitiveClosure.getDownstreamVertices(A, true);\n assertThat(transitiveClosure.getAllVertices(), containsInAnyOrder(A, aPlusB, C));\n }", "class_method_signature": "TransitiveClosureTest.doe...
{ "fields": [ { "declarator": "ADD_ALL = vertex -> true", "modifier": "private static final", "original_string": "private static final Predicate<Vertex> ADD_ALL = vertex -> true;", "type": "Predicate<Vertex>", "var_name": "ADD_ALL" }, { "declarator": "PROBABILISTIC_OR_O...
{ "body": "public static TransitiveClosure getDownstreamVertices(Vertex<?, ?> aVertex, boolean includeNonProbabilistic) {\n return getDownstreamVerticesForCollection(Collections.singletonList(aVertex), includeNonProbabilistic);\n }", "class_method_signature": "TransitiveClosure.getDownstreamVertices(Verte...
{ "created": null, "fork": null, "fork_count": 33, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 128393918, "size": 15461, "stargazer_count": 146, "stars": null, "updates": null, "url": "https://github.com/improbable-research/keanu" }
128393918_118
{ "fields": [ { "declarator": "epsilon = 0.01", "modifier": "private static", "original_string": "private static double epsilon = 0.01;", "type": "double", "var_name": "epsilon" }, { "declarator": "N = 100000", "modifier": "private static", "original_string"...
{ "body": "@Test\n public void cantCreateCategoricalVertexIfNonScalarShapeDoNotMatchProposedShape() {\n Map<TestEnum, DoubleVertex> selectableValues = new LinkedHashMap<>();\n selectableValues.put(TestEnum.A, ConstantVertex.of(t1));\n\n long[] proposalShape = new long[]{3, 5, 6};\n\n th...
{ "fields": [ { "declarator": "selectableValues", "modifier": "private final", "original_string": "private final Map<CATEGORY, DoubleVertex> selectableValues;", "type": "Map<CATEGORY, DoubleVertex>", "var_name": "selectableValues" } ], "file": "keanu-project/src/main/java/io/...
{ "body": "public static <CATEGORY> CategoricalVertex<CATEGORY> of(\n Map<CATEGORY, Double> selectableValues\n ) {\n return new CategoricalVertex<>(toDoubleVertices(selectableValues));\n }", "class_method_signature": "CategoricalVertex.of(\n Map<CATEGORY, Double> selectableValues\n )",...
{ "created": null, "fork": null, "fork_count": 33, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 128393918, "size": 15461, "stargazer_count": 146, "stars": null, "updates": null, "url": "https://github.com/improbable-research/keanu" }
128393918_231
{ "fields": [ { "declarator": "expectedException = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException expectedException = ExpectedException.none();", "type": "ExpectedException", "var_name": "expectedException" } ...
{ "body": "@Test\n public void aVertexLabelsWithANamespaceIsNoteEqualToOneWithoutANamespace() {\n VertexLabel foo1 = new VertexLabel(\"namespace\", \"foo\");\n VertexLabel foo2 = new VertexLabel(\"foo\");\n assertThat(foo1, not(equalTo(foo2)));\n assertThat(foo1.hashCode(), not(equalTo(...
{ "fields": [ { "declarator": "NAMESPACE_SEPARATOR = '.'", "modifier": "private static final", "original_string": "private static final char NAMESPACE_SEPARATOR = '.';", "type": "char", "var_name": "NAMESPACE_SEPARATOR" }, { "declarator": "namespace", "modifier": ...
{ "body": "@Override\n public int hashCode() {\n\n return Objects.hash(namespace, name);\n }", "class_method_signature": "VertexLabel.hashCode()", "constructor": false, "full_signature": "@Override public int hashCode()", "identifier": "hashCode", "invocations": [ "hash" ], "modifiers":...
{ "created": null, "fork": null, "fork_count": 33, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 128393918, "size": 15461, "stargazer_count": 146, "stars": null, "updates": null, "url": "https://github.com/improbable-research/keanu" }
128393918_60
{ "fields": [ { "declarator": "progressUpdateCall", "modifier": "private", "original_string": "private AtomicReference<Runnable> progressUpdateCall;", "type": "AtomicReference<Runnable>", "var_name": "progressUpdateCall" }, { "declarator": "statusBar", "modifier":...
{ "body": "@Test\n public void doesPrintProgressInAppropriateFormat() {\n StatusBar.enable();\n\n percentageComponent.progress(0.0);\n progressUpdateCall.get().run();\n percentageComponent.progress(0.675);\n statusBar.finish();\n\n String result = getResultWithNewLinesInst...
{ "fields": [ { "declarator": "percentage = new AtomicDouble(0.0)", "modifier": "private", "original_string": "private AtomicDouble percentage = new AtomicDouble(0.0);", "type": "AtomicDouble", "var_name": "percentage" } ], "file": "keanu-project/src/main/java/io/improbable/k...
{ "body": "public void progress(double percentage) {\n this.percentage.set(percentage);\n }", "class_method_signature": "PercentageComponent.progress(double percentage)", "constructor": false, "full_signature": "public void progress(double percentage)", "identifier": "progress", "invocations": [ ...
{ "created": null, "fork": null, "fork_count": 33, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 128393918, "size": 15461, "stargazer_count": 146, "stars": null, "updates": null, "url": "https://github.com/improbable-research/keanu" }
128393918_37
{ "fields": [ { "declarator": "thrown = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException thrown = ExpectedException.none();", "type": "ExpectedException", "var_name": "thrown" } ], "file": "keanu-project/src/t...
{ "body": "@Test\n public void canStackIfDimensionIsNegative() {\n BooleanTensor matrixD = BooleanTensor.create(new boolean[]{true, false}, 1, 2);\n assertThat(BooleanTensor.create(true, false, true, false).reshape(2, 1, 2), valuesAndShapesMatch(BooleanTensor.stack(-3, matrixD, matrixD)));\n a...
{ "fields": [ { "declarator": "factory = BooleanBuffer.factory", "modifier": "private static final", "original_string": "private static final BooleanBuffer.BooleanArrayWrapperFactory factory = BooleanBuffer.factory;", "type": "BooleanBuffer.BooleanArrayWrapperFactory", "var_name": "f...
{ "body": "@Override\n protected JVMBooleanTensor create(BooleanBuffer.PrimitiveBooleanWrapper buffer, long[] shape, long[] stride) {\n return new JVMBooleanTensor(buffer, shape, stride);\n }", "class_method_signature": "JVMBooleanTensor.create(BooleanBuffer.PrimitiveBooleanWrapper buffer, long[] shape...
{ "created": null, "fork": null, "fork_count": 33, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 128393918, "size": 15461, "stargazer_count": 146, "stars": null, "updates": null, "url": "https://github.com/improbable-research/keanu" }
128393918_266
{ "fields": [], "file": "keanu-project/src/test/java/io/improbable/keanu/algorithms/mcmc/NetworkSamplesGeneratorTest.java", "identifier": "NetworkSamplesGeneratorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void doesUpdateProgressAndFinishProgressWhenStreaming() {\n StatusBar progressBar = mock(StatusBar.class);\n TestSamplingAlgorithm algorithm = new TestSamplingAlgorithm(new AtomicInteger(0), new AtomicInteger(0));\n Stream<NetworkSample> sampleStream = new NetworkSamp...
{ "fields": [ { "declarator": "algorithm", "modifier": "private final", "original_string": "private final SamplingAlgorithm algorithm;", "type": "SamplingAlgorithm", "var_name": "algorithm" }, { "declarator": "dropCount = 0", "modifier": "private", "original...
{ "body": "public Stream<NetworkSample> stream() {\n\n StatusBar statusBar = statusBarSupplier.get();\n\n dropSamples(dropCount, statusBar);\n\n final AtomicInteger sampleNumber = new AtomicInteger(0);\n return Stream.generate(() -> {\n\n sampleNumber.getAndIncrement();\n\n ...
{ "created": null, "fork": null, "fork_count": 33, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 128393918, "size": 15461, "stargazer_count": 146, "stars": null, "updates": null, "url": "https://github.com/improbable-research/keanu" }
128393918_289
{ "fields": [], "file": "keanu-project/src/test/java/io/improbable/keanu/algorithms/mcmc/nuts/AdaptiveStepSizeTest.java", "identifier": "AdaptiveStepSizeTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void canUseSimpleHeuristicForInitialStepSize() {\n\n double stepScale = 0.25;\n double startingStepSizeSimple = AdaptiveStepSize.findStartingStepSize(stepScale, ImmutableList.of(\n ConstantVertex.of(DoubleTensor.arange(0, 5)),\n ConstantVertex.of(Double...
{ "fields": [ { "declarator": "t0 = 10", "modifier": "private static final", "original_string": "private static final double t0 = 10;", "type": "double", "var_name": "t0" }, { "declarator": "gamma = 0.05", "modifier": "private static final", "original_string...
{ "body": "public static double findStartingStepSize(double stepScale, List<? extends Variable<DoubleTensor, ?>> variables) {\n long N = variables.stream()\n .mapToLong(v -> v.getValue().getLength())\n .sum();\n\n return stepScale / Math.pow(N, 0.25);\n }", "class_method_signa...
{ "created": null, "fork": null, "fork_count": 33, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 128393918, "size": 15461, "stargazer_count": 146, "stars": null, "updates": null, "url": "https://github.com/improbable-research/keanu" }
128393918_323
{ "fields": [ { "declarator": "expectedException = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException expectedException = ExpectedException.none();", "type": "ExpectedException", "var_name": "expectedException" } ...
{ "body": "@Test\n public void shouldAllowObservationChange() {\n\n GaussianVertex A = new GaussianVertex(0, 1);\n GaussianVertex B = new GaussianVertex(A.abs(), 1);\n A.observe(2.0);\n\n GradientOptimizer optimizer = Keanu.Optimizer.Gradient.ofConnectedGraph(B);\n optimizer.maxA...
{ "fields": [ { "declarator": "FLAT_GRADIENT = 1e-16", "modifier": "private static final", "original_string": "private static final double FLAT_GRADIENT = 1e-16;", "type": "double", "var_name": "FLAT_GRADIENT" }, { "declarator": "probabilisticModelWithGradient", "...
{ "body": "@Override\n public OptimizedResult maxAPosteriori() {\n return optimize(ProbabilityFitness.MAP);\n }", "class_method_signature": "GradientOptimizer.maxAPosteriori()", "constructor": false, "full_signature": "@Override public OptimizedResult maxAPosteriori()", "identifier": "maxAPosteri...
{ "created": null, "fork": null, "fork_count": 33, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 128393918, "size": 15461, "stargazer_count": 146, "stars": null, "updates": null, "url": "https://github.com/improbable-research/keanu" }
128393918_354
{ "fields": [], "file": "keanu-examples/coalMiningDisasters/src/test/java/com/example/coal/ModelTest.java", "identifier": "ModelTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void shouldFindCorrectSwitchYear() {\n\n //Load data from a csv file\n Data coalMiningDisasterData = Data.load(\"coal-mining-disaster-data.csv\");\n\n //create my model using the data\n Model model = new Model(coalMiningDisasterData);\n model.run();\n\n ...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(Model.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(Model.class);", "type": "Logger", "var_name": "log" }, { "declarator": "earlyRat...
{ "body": "public void run() {\n KeanuProbabilisticModel model = new KeanuProbabilisticModel(buildBayesianNetwork());\n Integer numSamples = 500;\n\n results = Keanu.Sampling.MetropolisHastings.withDefaultConfig().generatePosteriorSamples(\n model,\n model.getLatentVariables...
{ "created": null, "fork": null, "fork_count": 33, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 128393918, "size": 15461, "stargazer_count": 146, "stars": null, "updates": null, "url": "https://github.com/improbable-research/keanu" }
128393918_211
{ "fields": [ { "declarator": "myRule = new DeterministicRule()", "modifier": "@Rule\n public", "original_string": "@Rule\n public DeterministicRule myRule = new DeterministicRule();", "type": "DeterministicRule", "var_name": "myRule" } ], "file": "keanu-project/src/tes...
{ "body": "@Test\n public void logProbGraphIsNegativeInfinityIfPGreaterThanOrEqualToOne() {\n DoubleVertex p = ConstantVertex.of(1.);\n GeometricVertex myVertex = new GeometricVertex(p);\n LogProbGraph logProbGraph = myVertex.logProbGraph();\n LogProbGraphValueFeeder.feedValue(logProbGr...
{ "fields": [ { "declarator": "p", "modifier": "private final", "original_string": "private final DoubleVertex p;", "type": "DoubleVertex", "var_name": "p" }, { "declarator": "P_NAME = \"p\"", "modifier": "private final static", "original_string": "private f...
{ "body": "@Override\n public LogProbGraph logProbGraph() {\n IntegerPlaceholderVertex valuePlaceholder = new IntegerPlaceholderVertex(this.getShape());\n DoublePlaceholderVertex pPlaceholder = new DoublePlaceholderVertex(p.getShape());\n\n return LogProbGraph.builder()\n .input(thi...
{ "created": null, "fork": null, "fork_count": 33, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 128393918, "size": 15461, "stargazer_count": 146, "stars": null, "updates": null, "url": "https://github.com/improbable-research/keanu" }
128393918_40
{ "fields": [ { "declarator": "thrown = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException thrown = ExpectedException.none();", "type": "ExpectedException", "var_name": "thrown" } ], "file": "keanu-project/src/t...
{ "body": "@Test\n public void canBroadcastAnd() {\n BooleanTensor a = BooleanTensor.create(\n true, true, false,\n true, true, true\n ).reshape(2, 3);\n\n BooleanTensor b = BooleanTensor.create(true, false, true);\n\n BooleanTensor actual = a.and(b);\n Bool...
{ "fields": [ { "declarator": "factory = BooleanBuffer.factory", "modifier": "private static final", "original_string": "private static final BooleanBuffer.BooleanArrayWrapperFactory factory = BooleanBuffer.factory;", "type": "BooleanBuffer.BooleanArrayWrapperFactory", "var_name": "f...
{ "body": "@Override\n protected JVMBooleanTensor create(BooleanBuffer.PrimitiveBooleanWrapper buffer, long[] shape, long[] stride) {\n return new JVMBooleanTensor(buffer, shape, stride);\n }", "class_method_signature": "JVMBooleanTensor.create(BooleanBuffer.PrimitiveBooleanWrapper buffer, long[] shape...
{ "created": null, "fork": null, "fork_count": 33, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 128393918, "size": 15461, "stargazer_count": 146, "stars": null, "updates": null, "url": "https://github.com/improbable-research/keanu" }
128393918_138
{ "fields": [ { "declarator": "thrown = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException thrown = ExpectedException.none();", "type": "ExpectedException", "var_name": "thrown" } ], "file": "keanu-project/src/t...
{ "body": "@Test\n public void canConcatenateAutoDiffOfManyMatricesAlongDimensionZero() {\n UniformVertex sharedMatrix = new UniformVertex(0, 10);\n sharedMatrix.setValue(DoubleTensor.create(new double[]{1, 2, 3, 4}, 2, 2));\n\n UniformVertex a = new UniformVertex(0, 10);\n a.setValue(D...
{ "fields": [ { "declarator": "DIMENSION_NAME = \"dimension\"", "modifier": "private final static", "original_string": "private final static String DIMENSION_NAME = \"dimension\";", "type": "String", "var_name": "DIMENSION_NAME" }, { "declarator": "OPERANDS_NAME = \"ope...
{ "body": "public static ForwardModePartialDerivative concat(List<ForwardModePartialDerivative> partialsOfOperands,\n List<DoubleTensor> operandValues,\n int dimension) {\n\n long[] wrtShape = null;\n ...
{ "created": null, "fork": null, "fork_count": 33, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 128393918, "size": 15461, "stargazer_count": 146, "stars": null, "updates": null, "url": "https://github.com/improbable-research/keanu" }
128393918_1
{ "fields": [], "file": "keanu-project/src/test/java/io/improbable/keanu/tensor/TensorShapeTest.java", "identifier": "TensorShapeTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void canCalculateLength() {\n long[] shape = new long[]{2, 3, 7, 4};\n assertEquals(168, TensorShape.getLength(shape));\n }", "class_method_signature": "TensorShapeTest.canCalculateLength()", "constructor": false, "full_signature": "@Test public void canCalculateLen...
{ "fields": [ { "declarator": "shape", "modifier": "private", "original_string": "private long[] shape;", "type": "long[]", "var_name": "shape" } ], "file": "keanu-project/src/main/java/io/improbable/keanu/tensor/TensorShape.java", "identifier": "TensorShape", "interfaces...
{ "body": "public static long getLength(long[] shape) {\n long length = 1;\n for (long dim : shape) {\n length *= dim;\n }\n return length;\n }", "class_method_signature": "TensorShape.getLength(long[] shape)", "constructor": false, "full_signature": "public static long...
{ "created": null, "fork": null, "fork_count": 33, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 128393918, "size": 15461, "stargazer_count": 146, "stars": null, "updates": null, "url": "https://github.com/improbable-research/keanu" }
128393918_303
{ "fields": [ { "declarator": "thrown = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException thrown = ExpectedException.none();", "type": "ExpectedException", "var_name": "thrown" }, { "declarator": "samples...
{ "body": "@Test(expected = IllegalArgumentException.class)\n public void doesCatchInvalidDropCount() {\n samples.drop(-1);\n }", "class_method_signature": "NetworkSamplesTest.doesCatchInvalidDropCount()", "constructor": false, "full_signature": "@Test(expected = IllegalArgumentException.class) pub...
{ "fields": [ { "declarator": "samplesByVariable", "modifier": "private final", "original_string": "private final Map<VariableReference, ? extends List> samplesByVariable;", "type": "Map<VariableReference, ? extends List>", "var_name": "samplesByVariable" }, { "declarat...
{ "body": "public NetworkSamples drop(int dropCount) {\n Preconditions.checkArgument(dropCount >= 0, \"Cannot drop %s samples. Drop count must be positive.\", dropCount);\n if (dropCount == 0) {\n return this;\n }\n\n final Map<VariableReference, List<?>> withSamplesDropped = sa...
{ "created": null, "fork": null, "fork_count": 33, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 128393918, "size": 15461, "stargazer_count": 146, "stars": null, "updates": null, "url": "https://github.com/improbable-research/keanu" }
128393918_17
{ "fields": [ { "declarator": "scalar1 = new long[0]", "modifier": "private", "original_string": "private long[] scalar1 = new long[0];", "type": "long[]", "var_name": "scalar1" }, { "declarator": "scalar2 = new long[0]", "modifier": "private", "original_str...
{ "body": "@Test\n public void suggestMatchingNonScalarShape() {\n long[] shapeProposal = TensorShapeValidation.checkHasOneNonLengthOneShapeOrAllLengthOne(scalar1, twoByTwo1, twoByTwo2);\n assertArrayEquals(new long[]{2, 2}, shapeProposal);\n }", "class_method_signature": "TensorShapeValidationT...
{ "fields": [], "file": "keanu-project/src/main/java/io/improbable/keanu/tensor/TensorShapeValidation.java", "identifier": "TensorShapeValidation", "interfaces": "", "methods": [ { "class_method_signature": "TensorShapeValidation.TensorShapeValidation()", "constructor": true, "full_signa...
{ "body": "public static long[] checkHasOneNonLengthOneShapeOrAllLengthOne(long[]... shapes) {\n Set<TensorShape> nonLengthOneShapes = getNonLengthOneShapes(shapes);\n List<TensorShape> lengthOneShapes = getLengthOneShapesSortedByRank(shapes);\n\n if (nonLengthOneShapes.isEmpty()) {\n ...
{ "created": null, "fork": null, "fork_count": 33, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 128393918, "size": 15461, "stargazer_count": 146, "stars": null, "updates": null, "url": "https://github.com/improbable-research/keanu" }
128393918_246
{ "fields": [ { "declarator": "expectedException = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException expectedException = ExpectedException.none();", "type": "ExpectedException", "var_name": "expectedException" } ...
{ "body": "@Test\n public void isNotInNamespaceWithDifferentInner() {\n VertexLabel label = new VertexLabel(\"outer\", \"inner\", \"foo\");\n assertFalse(label.isInNamespace(\"outer\", \"differentInner\"));\n }", "class_method_signature": "VertexLabelTest.isNotInNamespaceWithDifferentInner()", ...
{ "fields": [ { "declarator": "NAMESPACE_SEPARATOR = '.'", "modifier": "private static final", "original_string": "private static final char NAMESPACE_SEPARATOR = '.';", "type": "char", "var_name": "NAMESPACE_SEPARATOR" }, { "declarator": "namespace", "modifier": ...
{ "body": "public boolean isInNamespace(String... namespace) {\n\n if (namespace.length > this.namespace.size()) {\n return false;\n }\n\n for (int i = 0; i < namespace.length; i++) {\n if (!this.namespace.get(i).equals(namespace[i])) {\n return false;\n ...
{ "created": null, "fork": null, "fork_count": 33, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 128393918, "size": 15461, "stargazer_count": 146, "stars": null, "updates": null, "url": "https://github.com/improbable-research/keanu" }
128393918_180
{ "fields": [ { "declarator": "DELTA = 0.0001", "modifier": "private static final", "original_string": "private static final double DELTA = 0.0001;", "type": "double", "var_name": "DELTA" }, { "declarator": "random", "modifier": "private", "original_string":...
{ "body": "@Test\n public void logProbGraphMatchesKnownLogDensityOfVector() {\n DoubleVertex rate = ConstantVertex.of(1.0, 1.0);\n ExponentialVertex tensorExponentialVertex = new ExponentialVertex(rate);\n LogProbGraph logProbGraph = tensorExponentialVertex.logProbGraph();\n LogProbGrap...
{ "fields": [ { "declarator": "rate", "modifier": "private final", "original_string": "private final DoubleVertex rate;", "type": "DoubleVertex", "var_name": "rate" }, { "declarator": "RATE_NAME = \"rate\"", "modifier": "private static final", "original_stri...
{ "body": "@Override\n public LogProbGraph logProbGraph() {\n final DoublePlaceholderVertex xPlaceholder = new DoublePlaceholderVertex(this.getShape());\n final DoublePlaceholderVertex ratePlaceholder = new DoublePlaceholderVertex(rate.getShape());\n\n return LogProbGraph.builder()\n ...
{ "created": null, "fork": null, "fork_count": 33, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 128393918, "size": 15461, "stargazer_count": 146, "stars": null, "updates": null, "url": "https://github.com/improbable-research/keanu" }
128393918_315
{ "fields": [ { "declarator": "thrown = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException thrown = ExpectedException.none();", "type": "ExpectedException", "var_name": "thrown" }, { "declarator": "qDist",...
{ "body": "@Test\n public void throwsExceptionIfPProbIsNotZeroButQIs() {\n when(qDist.getLogOfMasterP(any(NetworkState.class))).thenReturn(Double.NEGATIVE_INFINITY);\n NetworkSamples samples = createNetworkSamplesWithOneVertexAndOneSample(Math.log(0.5));\n\n thrown.expect(IllegalArgumentExcept...
{ "fields": [], "file": "keanu-project/src/main/java/io/improbable/keanu/algorithms/variational/KLDivergence.java", "identifier": "KLDivergence", "interfaces": "", "methods": [ { "class_method_signature": "KLDivergence.compute(QDistribution q, NetworkSamples p)", "constructor": false, "f...
{ "body": "public static double compute(QDistribution q, NetworkSamples p) {\n return compute(p, q::getLogOfMasterP);\n }", "class_method_signature": "KLDivergence.compute(QDistribution q, NetworkSamples p)", "constructor": false, "full_signature": "public static double compute(QDistribution q, Networ...
{ "created": null, "fork": null, "fork_count": 33, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 128393918, "size": 15461, "stargazer_count": 146, "stars": null, "updates": null, "url": "https://github.com/improbable-research/keanu" }
128393918_250
{ "fields": [ { "declarator": "A", "modifier": "private", "original_string": "private DoubleVertex A;", "type": "DoubleVertex", "var_name": "A" }, { "declarator": "B", "modifier": "private", "original_string": "private DoubleVertex B;", "type": "Double...
{ "body": "@Test\n public void canConvertSimpleGraphToComputationalGraph() {\n String cLabel = \"C\";\n DoubleVertex C = A.plus(B);\n C.getValue();\n C.setLabel(cLabel);\n\n List<Vertex> toposortedGraph = C.getConnectedGraph().stream()\n .sorted(Comparator.comparing(Ve...
{ "fields": [ { "declarator": "vertexLookup", "modifier": "private final", "original_string": "private final Map<VariableReference, Vertex> vertexLookup;", "type": "Map<VariableReference, Vertex>", "var_name": "vertexLookup" }, { "declarator": "topoSortedGraph", "...
{ "body": "@Override\n public Map<VariableReference, ?> compute(Map<VariableReference, ?> inputs) {\n\n for (Map.Entry<VariableReference, ?> input : inputs.entrySet()) {\n vertexLookup.get(input.getKey()).setValue(input.getValue());\n }\n\n for (int i = 0; i < topoSortedGraph.size()...
{ "created": null, "fork": null, "fork_count": 33, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 128393918, "size": 15461, "stargazer_count": 146, "stars": null, "updates": null, "url": "https://github.com/improbable-research/keanu" }
128393918_179
{ "fields": [ { "declarator": "DELTA = 0.0001", "modifier": "private static final", "original_string": "private static final double DELTA = 0.0001;", "type": "double", "var_name": "DELTA" }, { "declarator": "random", "modifier": "private", "original_string":...
{ "body": "@Test\n public void logProbGraphMatchesKnownLogDensityOfScalar() {\n DoubleVertex rate = ConstantVertex.of(1.5);\n ExponentialVertex tensorExponentialVertex = new ExponentialVertex(rate);\n LogProbGraph logProbGraph = tensorExponentialVertex.logProbGraph();\n LogProbGraphValu...
{ "fields": [ { "declarator": "rate", "modifier": "private final", "original_string": "private final DoubleVertex rate;", "type": "DoubleVertex", "var_name": "rate" }, { "declarator": "RATE_NAME = \"rate\"", "modifier": "private static final", "original_stri...
{ "body": "@Override\n public LogProbGraph logProbGraph() {\n final DoublePlaceholderVertex xPlaceholder = new DoublePlaceholderVertex(this.getShape());\n final DoublePlaceholderVertex ratePlaceholder = new DoublePlaceholderVertex(rate.getShape());\n\n return LogProbGraph.builder()\n ...
{ "created": null, "fork": null, "fork_count": 33, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 128393918, "size": 15461, "stargazer_count": 146, "stars": null, "updates": null, "url": "https://github.com/improbable-research/keanu" }
128393918_196
{ "fields": [], "file": "keanu-project/src/test/java/io/improbable/keanu/vertices/tensor/number/floating/dbl/DifferentiatorTest.java", "identifier": "DifferentiatorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void canReverseAutoDiffOfMultiplicationWithSingleOutputWithRespectToMany() {\n\n DoubleVertex A = new GaussianVertex(0, 1);\n DoubleVertex B = new GaussianVertex(0, 1);\n DoubleVertex C = A.times(B);\n\n PartialsOf dC = Differentiator.reverseModeAutoDiff(C, Imm...
{ "fields": [], "file": "keanu-project/src/main/java/io/improbable/keanu/vertices/tensor/number/floating/dbl/Differentiator.java", "identifier": "Differentiator", "interfaces": "", "methods": [ { "class_method_signature": "Differentiator.forwardModeAutoDiff(V wrt, V... of)", "constructor": fal...
{ "body": "public static PartialsOf reverseModeAutoDiff(Vertex ofVertex, Set<? extends Vertex> wrt) {\n if (ofVertex.isObserved()) {\n return new PartialsOf(ofVertex, Collections.emptyMap());\n } else {\n return reverseModeAutoDiff(ofVertex, Differentiable.ofSelfWrtSelf(ofVertex.ge...
{ "created": null, "fork": null, "fork_count": 33, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 128393918, "size": 15461, "stargazer_count": 146, "stars": null, "updates": null, "url": "https://github.com/improbable-research/keanu" }
128393918_342
{ "fields": [ { "declarator": "ROWS = Arrays.asList(\n new Bean(0),\n new Bean(0),\n new Bean(0)\n )", "modifier": "private static final", "original_string": "private static final List<Bean> ROWS = Arrays.asList(\n new Bean(0),\n new Bean(0),\n new Be...
{ "body": "@Test\n public void youCanPutTheSameVertexIntoMultipleSequenceItems() {\n VertexLabel thetaLabel = new VertexLabel(\"theta\");\n VertexLabel flipLabel = new VertexLabel(\"flip\");\n GaussianVertex commonTheta = new GaussianVertex(0.5, 0.01);\n\n new SequenceBuilder<Bean>()\n ...
{ "fields": [ { "declarator": "PROXY_LABEL_MARKER = \"proxy_for\"", "modifier": "private static final", "original_string": "private static final String PROXY_LABEL_MARKER = \"proxy_for\";", "type": "String", "var_name": "PROXY_LABEL_MARKER" }, { "declarator": "initialSt...
{ "body": "public FromCount count(int count) {\n return new FromCount(count, initialState);\n }", "class_method_signature": "SequenceBuilder.count(int count)", "constructor": false, "full_signature": "public FromCount count(int count)", "identifier": "count", "invocations": [], "modifiers": "pub...
{ "created": null, "fork": null, "fork_count": 33, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 128393918, "size": 15461, "stargazer_count": 146, "stars": null, "updates": null, "url": "https://github.com/improbable-research/keanu" }
128393918_56
{ "fields": [ { "declarator": "complexResultVertex", "modifier": "private static", "original_string": "private static Vertex complexResultVertex;", "type": "Vertex", "var_name": "complexResultVertex" }, { "declarator": "complexNetDotSaver", "modifier": "private st...
{ "body": "@Test\n public void valuesAreBeingWrittenOut() throws IOException {\n DoubleVertex unobservedGaussianVertex = new GaussianVertex(0, 1);\n DoubleVertex observedGammaVertex = new GammaVertex(2, 3);\n observedGammaVertex.observe(2.5);\n DoubleVertex gammaMultipliedVertex = obser...
{ "fields": [ { "declarator": "DOT_HEADER = \"digraph BayesianNetwork {\\n\"", "modifier": "private static final", "original_string": "private static final String DOT_HEADER = \"digraph BayesianNetwork {\\n\";", "type": "String", "var_name": "DOT_HEADER" }, { "declarato...
{ "body": "public void save(OutputStream output, boolean saveValues) throws IOException {\n save(output, saveValues, null);\n }", "class_method_signature": "DotSaver.save(OutputStream output, boolean saveValues)", "constructor": false, "full_signature": "public void save(OutputStream output, boolean s...
{ "created": null, "fork": null, "fork_count": 33, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 128393918, "size": 15461, "stargazer_count": 146, "stars": null, "updates": null, "url": "https://github.com/improbable-research/keanu" }
128393918_207
{ "fields": [ { "declarator": "myRule = new DeterministicRule()", "modifier": "@Rule\n public", "original_string": "@Rule\n public DeterministicRule myRule = new DeterministicRule();", "type": "DeterministicRule", "var_name": "myRule" } ], "file": "keanu-project/src/tes...
{ "body": "@Test\n public void logProbIsCorrectScalar() {\n double p = 0.25;\n GeometricVertex myVertex = new GeometricVertex(p);\n\n for (int i = 1; i < 20; i++) {\n assertEquals(getExpectedPmf(p, i), myVertex.logProb(IntegerTensor.create(i)), 1e-6);\n }\n }", "class_me...
{ "fields": [ { "declarator": "p", "modifier": "private final", "original_string": "private final DoubleVertex p;", "type": "DoubleVertex", "var_name": "p" }, { "declarator": "P_NAME = \"p\"", "modifier": "private final static", "original_string": "private f...
{ "body": "@Override\n public double logProb(IntegerTensor value) {\n return Geometric.withParameters(p.getValue()).logProb(value).sumNumber();\n }", "class_method_signature": "GeometricVertex.logProb(IntegerTensor value)", "constructor": false, "full_signature": "@Override public double logProb(In...
{ "created": null, "fork": null, "fork_count": 33, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 128393918, "size": 15461, "stargazer_count": 146, "stars": null, "updates": null, "url": "https://github.com/improbable-research/keanu" }
128393918_293
{ "fields": [ { "declarator": "deterministicRule = new DeterministicRule()", "modifier": "@Rule\n public", "original_string": "@Rule\n public DeterministicRule deterministicRule = new DeterministicRule();", "type": "DeterministicRule", "var_name": "deterministicRule" }, ...
{ "body": "@Test\n public void doesRejectWhenRejectProbabilityIsOne() {\n DoubleVertex A = new GaussianVertex(0, 1);\n A.setValue(0.5);\n DoubleVertex B = A.times(2);\n DoubleVertex C = new GaussianVertex(B, 1);\n C.observe(5.0);\n ProbabilisticModel model = new KeanuProba...
{ "fields": [ { "declarator": "DEFAULT_TEMPERATURE = 1.0", "modifier": "private static final", "original_string": "private static final double DEFAULT_TEMPERATURE = 1.0;", "type": "double", "var_name": "DEFAULT_TEMPERATURE" }, { "declarator": "model", "modifier": ...
{ "body": "public StepResult step(final Set<Variable> chosenVariables,\n final double logProbabilityBeforeStep) {\n return step(chosenVariables, logProbabilityBeforeStep, DEFAULT_TEMPERATURE);\n }", "class_method_signature": "MetropolisHastingsStep.step(final Set<Variable> chosen...
{ "created": null, "fork": null, "fork_count": 33, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 128393918, "size": 15461, "stargazer_count": 146, "stars": null, "updates": null, "url": "https://github.com/improbable-research/keanu" }
128393918_339
{ "fields": [ { "declarator": "ROWS = Arrays.asList(\n new Bean(0),\n new Bean(0),\n new Bean(0)\n )", "modifier": "private static final", "original_string": "private static final List<Bean> ROWS = Arrays.asList(\n new Bean(0),\n new Bean(0),\n new Be...
{ "body": "@Test(expected = IllegalArgumentException.class)\n public void youCannotAddTheSameLabelTwiceIntoOneSequenceItem() {\n new SequenceBuilder<Integer>()\n .count(10)\n .withFactory((item) -> {\n VertexLabel label = new VertexLabel(\"x\");\n DoubleVe...
{ "fields": [ { "declarator": "PROXY_LABEL_MARKER = \"proxy_for\"", "modifier": "private static final", "original_string": "private static final String PROXY_LABEL_MARKER = \"proxy_for\";", "type": "String", "var_name": "PROXY_LABEL_MARKER" }, { "declarator": "initialSt...
{ "body": "public FromCount count(int count) {\n return new FromCount(count, initialState);\n }", "class_method_signature": "SequenceBuilder.count(int count)", "constructor": false, "full_signature": "public FromCount count(int count)", "identifier": "count", "invocations": [], "modifiers": "pub...
{ "created": null, "fork": null, "fork_count": 33, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 128393918, "size": 15461, "stargazer_count": 146, "stars": null, "updates": null, "url": "https://github.com/improbable-research/keanu" }
128393918_155
{ "fields": [ { "declarator": "random", "modifier": "private", "original_string": "private KeanuRandom random;", "type": "KeanuRandom", "var_name": "random" }, { "declarator": "thrown = ExpectedException.none()", "modifier": "@Rule\n public", "original_st...
{ "body": "@Test\n public void logProbGraphIsFlatUniformIfAllConcentrationValuesAreOne() {\n DoubleVertex concentration = ConstantVertex.of(DoubleTensor.create(1, new long[]{1, 4}));\n DirichletVertex dirichlet = new DirichletVertex(concentration);\n\n LogProbGraph logProbGraph1 = dirichlet.lo...
{ "fields": [ { "declarator": "concentration", "modifier": "private final", "original_string": "private final DoubleVertex concentration;", "type": "DoubleVertex", "var_name": "concentration" }, { "declarator": "CONCENTRATION_NAME = \"concentration\"", "modifier":...
{ "body": "@Override\n public LogProbGraph logProbGraph() {\n DoublePlaceholderVertex xPlaceholder = new DoublePlaceholderVertex(this.getShape());\n DoublePlaceholderVertex concentrationPlaceholder = new DoublePlaceholderVertex(concentration.getShape());\n\n return LogProbGraph.builder()\n ...
{ "created": null, "fork": null, "fork_count": 33, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 128393918, "size": 15461, "stargazer_count": 146, "stars": null, "updates": null, "url": "https://github.com/improbable-research/keanu" }
128393918_95
{ "fields": [ { "declarator": "thrown = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException thrown = ExpectedException.none();", "type": "ExpectedException", "var_name": "thrown" }, { "declarator": "network...
{ "body": "@Test\n public void throwsIfVertexWithLabelIsNotInBayesianNetwork() {\n BooleanVertex vertexInNetwork = new BernoulliVertex(0.5).setLabel(LABEL_A);\n BayesianNetwork network = new BayesianNetwork(vertexInNetwork.getConnectedGraph());\n\n BooleanVertex vertexNotInNetwork = new Bernou...
{ "fields": [ { "declarator": "vertices", "modifier": "private final", "original_string": "private final List<? extends Vertex> vertices;", "type": "List<? extends Vertex>", "var_name": "vertices" }, { "declarator": "vertexLabels", "modifier": "private final", ...
{ "body": "public Vertex getVertexByLabel(VertexLabel label) {\n Preconditions.checkArgument(vertexLabels.containsKey(label), String.format(\"Vertex with label %s was not found in BayesianNetwork.\", label));\n return vertexLabels.get(label);\n }", "class_method_signature": "BayesianNetwork.getVert...
{ "created": null, "fork": null, "fork_count": 33, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 128393918, "size": 15461, "stargazer_count": 146, "stars": null, "updates": null, "url": "https://github.com/improbable-research/keanu" }
128393918_102
{ "fields": [ { "declarator": "Amu", "modifier": "", "original_string": "DoubleVertex Amu;", "type": "DoubleVertex", "var_name": "Amu" }, { "declarator": "Asigma", "modifier": "", "original_string": "DoubleVertex Asigma;", "type": "DoubleVertex", ...
{ "body": "@Test\n public void doesGetUpstreamProbabilisticVerticesOfCollection() {\n TransitiveClosure transitiveClosure = TransitiveClosure.getUpstreamVerticesForCollection(Arrays.asList(C, cSigma), false);\n assertThat(transitiveClosure.getLatentAndObservedVertices(), containsInAnyOrder(A, B, C));...
{ "fields": [ { "declarator": "ADD_ALL = vertex -> true", "modifier": "private static final", "original_string": "private static final Predicate<Vertex> ADD_ALL = vertex -> true;", "type": "Predicate<Vertex>", "var_name": "ADD_ALL" }, { "declarator": "PROBABILISTIC_OR_O...
{ "body": "public static TransitiveClosure getUpstreamVerticesForCollection(List<Vertex> vertices, boolean includeNonProbabilistic) {\n\n Predicate<Vertex> shouldAdd = includeNonProbabilistic ? ADD_ALL : PROBABILISTIC_OR_OBSERVED_ONLY;\n\n Set<Vertex> upstreamVertices = getVertices(\n vertice...
{ "created": null, "fork": null, "fork_count": 33, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 128393918, "size": 15461, "stargazer_count": 146, "stars": null, "updates": null, "url": "https://github.com/improbable-research/keanu" }
128393918_83
{ "fields": [ { "declarator": "expectedException = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException expectedException = ExpectedException.none();", "type": "ExpectedException", "var_name": "expectedException" } ...
{ "body": "@Test\n public void canCreateBooleanArrayFromByteArray() {\n byte byte1 = (byte) Integer.parseInt(\"10101010\", 2);\n byte byte2 = (byte) Integer.parseInt(\"10000000\", 2);\n byte[] bytes = new byte[]{byte1, byte2};\n\n boolean[] bools = Py4jByteArrayConverter.toBooleanArray(...
{ "fields": [], "file": "keanu-project/src/main/java/io/improbable/keanu/util/Py4jByteArrayConverter.java", "identifier": "Py4jByteArrayConverter", "interfaces": "", "methods": [ { "class_method_signature": "Py4jByteArrayConverter.toByteArray(double[] doubleArray)", "constructor": false, ...
{ "body": "public static boolean[] toBooleanArray(byte[] byteArray, int numberOfBooleansInArray) {\n BitSet bits = BitSet.valueOf(byteArray);\n boolean[] bools = new boolean[numberOfBooleansInArray];\n for (int i = bits.nextSetBit(0); i != -1; i = bits.nextSetBit(i + 1)) {\n int positi...
{ "created": null, "fork": null, "fork_count": 33, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 128393918, "size": 15461, "stargazer_count": 146, "stars": null, "updates": null, "url": "https://github.com/improbable-research/keanu" }
128393918_114
{ "fields": [ { "declarator": "N = 100000", "modifier": "private", "original_string": "private int N = 100000;", "type": "int", "var_name": "N" }, { "declarator": "epsilon = 0.01", "modifier": "private", "original_string": "private double epsilon = 0.01;", ...
{ "body": "@Test\n public void canStaticMuxWithIntegerSelect() {\n assertEquals(MultiplexerVertex.mux(IntegerTensor.scalar(0), \"a\", \"b\", \"c\"), \"a\");\n assertEquals(MultiplexerVertex.mux(IntegerTensor.scalar(1), \"a\", \"b\", \"c\"), \"b\");\n assertEquals(MultiplexerVertex.mux(IntegerT...
{ "fields": [ { "declarator": "SELECTOR_CONTROL_NAME = \"selectorControlVertex\"", "modifier": "private final static", "original_string": "private final static String SELECTOR_CONTROL_NAME = \"selectorControlVertex\";", "type": "String", "var_name": "SELECTOR_CONTROL_NAME" }, ...
{ "body": "public static <T> T mux(IntegerTensor select, T... outputs) {\n return outputs[select.scalar()];\n }", "class_method_signature": "MultiplexerVertex.mux(IntegerTensor select, T... outputs)", "constructor": false, "full_signature": "public static T mux(IntegerTensor select, T... outputs)", ...
{ "created": null, "fork": null, "fork_count": 33, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 128393918, "size": 15461, "stargazer_count": 146, "stars": null, "updates": null, "url": "https://github.com/improbable-research/keanu" }
128393918_285
{ "fields": [ { "declarator": "rule = new DeterministicRule()", "modifier": "@Rule\n public", "original_string": "@Rule\n public DeterministicRule rule = new DeterministicRule();", "type": "DeterministicRule", "var_name": "rule" } ], "file": "keanu-project/src/test/java...
{ "body": "@Test(expected = IllegalArgumentException.class)\n public void doesValidateMaxTreeHeight() {\n NUTS.builder().maxTreeHeight(0);\n }", "class_method_signature": "NUTSTest.doesValidateMaxTreeHeight()", "constructor": false, "full_signature": "@Test(expected = IllegalArgumentException.class...
{ "fields": [ { "declarator": "random", "modifier": "@Getter\n private final", "original_string": "@Getter\n private final KeanuRandom random;", "type": "KeanuRandom", "var_name": "random" }, { "declarator": "targetAcceptanceProb", "modifier": "@Getter\n ...
{ "body": "public static NUTSBuilder builder() {\n return new NUTSBuilder();\n }", "class_method_signature": "NUTS.builder()", "constructor": false, "full_signature": "public static NUTSBuilder builder()", "identifier": "builder", "invocations": [], "modifiers": "public static", "parameters": ...
{ "created": null, "fork": null, "fork_count": 33, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 128393918, "size": 15461, "stargazer_count": 146, "stars": null, "updates": null, "url": "https://github.com/improbable-research/keanu" }
128393918_143
{ "fields": [ { "declarator": "values = ImmutableList.of(\n DoubleTensor.create(new double[]{0, 16, 4}, 1, 3),\n DoubleTensor.create(new double[]{-4, -8, 4}, 1, 3),\n DoubleTensor.create(new double[]{8, -4, 12}, 1, 3),\n DoubleTensor.create(new double[]{4, 4, 8}, 1, 3)\n )", ...
{ "body": "@Test\n public void canGetAutocorrelationOnScalarSample() {\n List<DoubleTensor> sampleValues = ImmutableList.of(\n DoubleTensor.create(0, Tensor.SCALAR_SHAPE),\n DoubleTensor.create(-4, Tensor.SCALAR_SHAPE),\n DoubleTensor.create(8, Tensor.SCALAR_SHAPE),\n ...
{ "fields": [ { "declarator": "sampleShape[]", "modifier": "private final", "original_string": "private final long sampleShape[];", "type": "long", "var_name": "sampleShape" } ], "file": "keanu-project/src/main/java/io/improbable/keanu/vertices/tensor/number/floating/dbl/Doub...
{ "body": "public DoubleTensor getAutocorrelation(long... index) {\n TensorShapeValidation.checkIndexIsValid(sampleShape, index);\n long[] indexToGet = getCorrectIndexIfScalar(index);\n double[] sampleValuesAtIndex = samples.stream()\n .mapToDouble(x -> x.getValue(indexToGet))\n ...
{ "created": null, "fork": null, "fork_count": 33, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 128393918, "size": 15461, "stargazer_count": 146, "stars": null, "updates": null, "url": "https://github.com/improbable-research/keanu" }
128393918_142
{ "fields": [ { "declarator": "values = ImmutableList.of(\n DoubleTensor.create(new double[]{0, 16, 4}, 1, 3),\n DoubleTensor.create(new double[]{-4, -8, 4}, 1, 3),\n DoubleTensor.create(new double[]{8, -4, 12}, 1, 3),\n DoubleTensor.create(new double[]{4, 4, 8}, 1, 3)\n )", ...
{ "body": "@Test\n public void doesCalculateAutocorrelation() {\n List<DoubleTensor> expectedAutocorrelations = ImmutableList.of(\n DoubleTensor.create(new double[]{1, -0.15, -0.3, -0.05}, new long[]{1, 4}),\n DoubleTensor.create(new double[]{1., -0.27380952, -0.30952381, 0.08333333}, ...
{ "fields": [ { "declarator": "sampleShape[]", "modifier": "private final", "original_string": "private final long sampleShape[];", "type": "long", "var_name": "sampleShape" } ], "file": "keanu-project/src/main/java/io/improbable/keanu/vertices/tensor/number/floating/dbl/Doub...
{ "body": "public DoubleTensor getAutocorrelation(long... index) {\n TensorShapeValidation.checkIndexIsValid(sampleShape, index);\n long[] indexToGet = getCorrectIndexIfScalar(index);\n double[] sampleValuesAtIndex = samples.stream()\n .mapToDouble(x -> x.getValue(indexToGet))\n ...
{ "created": null, "fork": null, "fork_count": 33, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 128393918, "size": 15461, "stargazer_count": 146, "stars": null, "updates": null, "url": "https://github.com/improbable-research/keanu" }
128393918_284
{ "fields": [ { "declarator": "rule = new DeterministicRule()", "modifier": "@Rule\n public", "original_string": "@Rule\n public DeterministicRule rule = new DeterministicRule();", "type": "DeterministicRule", "var_name": "rule" } ], "file": "keanu-project/src/test/java...
{ "body": "@Test(expected = IllegalArgumentException.class)\n public void doesValidateMaxEnergyChange() {\n NUTS.builder().maxEnergyChange(-0.1);\n }", "class_method_signature": "NUTSTest.doesValidateMaxEnergyChange()", "constructor": false, "full_signature": "@Test(expected = IllegalArgumentExcept...
{ "fields": [ { "declarator": "random", "modifier": "@Getter\n private final", "original_string": "@Getter\n private final KeanuRandom random;", "type": "KeanuRandom", "var_name": "random" }, { "declarator": "targetAcceptanceProb", "modifier": "@Getter\n ...
{ "body": "public static NUTSBuilder builder() {\n return new NUTSBuilder();\n }", "class_method_signature": "NUTS.builder()", "constructor": false, "full_signature": "public static NUTSBuilder builder()", "identifier": "builder", "invocations": [], "modifiers": "public static", "parameters": ...
{ "created": null, "fork": null, "fork_count": 33, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 128393918, "size": 15461, "stargazer_count": 146, "stars": null, "updates": null, "url": "https://github.com/improbable-research/keanu" }
128393918_115
{ "fields": [ { "declarator": "epsilon = 0.01", "modifier": "private static", "original_string": "private static double epsilon = 0.01;", "type": "double", "var_name": "epsilon" }, { "declarator": "N = 100000", "modifier": "private static", "original_string"...
{ "body": "@Test\n public void cantCreateCategoricalVertexIfShapeIsNotSpecifiedAndNonScalarShapesDoNotMatch() {\n DoubleTensor t2 = DoubleTensor.create(new double[]{0., 0.5, 0.8, 0.2}, 4, 1);\n Map<TestEnum, DoubleVertex> selectableValues = new LinkedHashMap<>();\n selectableValues.put(TestEnu...
{ "fields": [ { "declarator": "selectableValues", "modifier": "private final", "original_string": "private final Map<CATEGORY, DoubleVertex> selectableValues;", "type": "Map<CATEGORY, DoubleVertex>", "var_name": "selectableValues" } ], "file": "keanu-project/src/main/java/io/...
{ "body": "public static <CATEGORY> CategoricalVertex<CATEGORY> of(\n Map<CATEGORY, Double> selectableValues\n ) {\n return new CategoricalVertex<>(toDoubleVertices(selectableValues));\n }", "class_method_signature": "CategoricalVertex.of(\n Map<CATEGORY, Double> selectableValues\n )",...
{ "created": null, "fork": null, "fork_count": 33, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 128393918, "size": 15461, "stargazer_count": 146, "stars": null, "updates": null, "url": "https://github.com/improbable-research/keanu" }
128393918_82
{ "fields": [ { "declarator": "expectedException = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException expectedException = ExpectedException.none();", "type": "ExpectedException", "var_name": "expectedException" } ...
{ "body": "@Test\n public void canCreateDoubleArrayFromByteArray() {\n byte byte1 = Byte.parseByte(\"01000000\", 2);\n byte byte2 = Byte.parseByte(\"00011000\", 2);\n byte byte3 = Byte.parseByte(\"00001000\", 2);\n byte zeroByte = Byte.parseByte(\"00000000\", 2);\n byte[] bytes =...
{ "fields": [], "file": "keanu-project/src/main/java/io/improbable/keanu/util/Py4jByteArrayConverter.java", "identifier": "Py4jByteArrayConverter", "interfaces": "", "methods": [ { "class_method_signature": "Py4jByteArrayConverter.toByteArray(double[] doubleArray)", "constructor": false, ...
{ "body": "public static double[] toDoubleArray(byte[] byteArray) {\n double[] doubles = new double[byteArray.length / Double.BYTES];\n for (int i = 0; i < doubles.length; i++) {\n doubles[i] = ByteBuffer.wrap(byteArray, i * Double.BYTES, Double.BYTES).order(ByteOrder.LITTLE_ENDIAN).getDouble...
{ "created": null, "fork": null, "fork_count": 33, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 128393918, "size": 15461, "stargazer_count": 146, "stars": null, "updates": null, "url": "https://github.com/improbable-research/keanu" }