task_type
stringclasses
4 values
code_task
stringclasses
15 values
start_line
int64
4
1.79k
end_line
int64
4
1.8k
before
stringlengths
79
76.1k
between
stringlengths
17
806
after
stringlengths
2
72.6k
reason_categories_output
stringlengths
2
2.24k
horizon_categories_output
stringlengths
83
3.99k
reason_freq_analysis
stringclasses
150 values
horizon_freq_analysis
stringlengths
23
185
completion_java
DoubleVectorTester
348
348
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.lang.Math;', 'import java.util.*;', '', '/**', ' * This abstract class serves as the basis from which all of the DoubleVector', ' * implementations should be extended. Most of the methods are abstract, but', ' * this class does provide imple...
[' returnVal += Math.abs ((myLength - nonEmptyEls) * baselineValue);']
[' return returnVal;', ' }', ' ', ' public void addMyselfToHim (IDoubleVector addToHim) throws OutOfBoundsException {', ' // make sure that the two vectors have the same length', ' if (getLength() != addToHim.getLength ()) {', ' throw new OutOfBoundsException ("unequal lengths in addMyselfToHim");', ' ...
[]
Library 'Math' used at line 348 is defined at line 3 and has a Long-Range dependency. Global_Variable 'myLength' used at line 348 is defined at line 307 and has a Long-Range dependency. Variable 'nonEmptyEls' used at line 348 is defined at line 341 and has a Short-Range dependency. Global_Variable 'baselineValue' used ...
{}
{'Library Long-Range': 1, 'Global_Variable Long-Range': 2, 'Variable Short-Range': 2}
completion_java
DoubleVectorTester
354
354
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.lang.Math;', 'import java.util.*;', '', '/**', ' * This abstract class serves as the basis from which all of the DoubleVector', ' * implementations should be extended. Most of the methods are abstract, but', ' * this class does provide imple...
[' if (getLength() != addToHim.getLength ()) {']
[' throw new OutOfBoundsException ("unequal lengths in addMyselfToHim");', ' }', ' ', ' // add every non-default value to the other guy', ' for (IIndexedData<Double> el : nonEmptyEntries) {', ' double myVal = el.getData();', ' int curIndex = el.getIndex();', ' myVal += addToHim.getItem (cu...
[{'reason_category': 'If Condition', 'usage_line': 354}]
Function 'getLength' used at line 354 is defined at line 20 and has a Long-Range dependency. Variable 'addToHim' used at line 354 is defined at line 352 and has a Short-Range dependency.
{'If Condition': 1}
{'Function Long-Range': 1, 'Variable Short-Range': 1}
completion_java
DoubleVectorTester
367
367
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.lang.Math;', 'import java.util.*;', '', '/**', ' * This abstract class serves as the basis from which all of the DoubleVector', ' * implementations should be extended. Most of the methods are abstract, but', ' * this class does provide imple...
[' addToHim.addToAll (baselineValue);']
[' }', ' ', ' public void addToAll (double addMe) {', ' baselineValue += addMe;', ' }', ' ', ' public double getItem (int whichOne) throws OutOfBoundsException {', ' ', ' // make sure we are not out of bounds', ' if (whichOne >= myLength || whichOne < 0) {', ' throw new OutOfBoundsException (...
[]
Variable 'addToHim' used at line 367 is defined at line 352 and has a Medium-Range dependency. Global_Variable 'baselineValue' used at line 367 is defined at line 304 and has a Long-Range dependency.
{}
{'Variable Medium-Range': 1, 'Global_Variable Long-Range': 1}
completion_java
DoubleVectorTester
377
377
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.lang.Math;', 'import java.util.*;', '', '/**', ' * This abstract class serves as the basis from which all of the DoubleVector', ' * implementations should be extended. Most of the methods are abstract, but', ' * this class does provide imple...
[' if (whichOne >= myLength || whichOne < 0) {']
[' throw new OutOfBoundsException ("index too large in getItem");', ' }', ' ', ' // now, look the thing up', ' Double myVal = nonEmptyEntries.get (whichOne);', ' if (myVal == null) {', ' return baselineValue;', ' } else {', ' return myVal + baselineValue;', ' }', ' }', ' ', ' publ...
[{'reason_category': 'If Condition', 'usage_line': 377}]
Variable 'whichOne' used at line 377 is defined at line 374 and has a Short-Range dependency. Global_Variable 'myLength' used at line 377 is defined at line 307 and has a Long-Range dependency.
{'If Condition': 1}
{'Variable Short-Range': 1, 'Global_Variable Long-Range': 1}
completion_java
DoubleVectorTester
382
382
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.lang.Math;', 'import java.util.*;', '', '/**', ' * This abstract class serves as the basis from which all of the DoubleVector', ' * implementations should be extended. Most of the methods are abstract, but', ' * this class does provide imple...
[' Double myVal = nonEmptyEntries.get (whichOne);']
[' if (myVal == null) {', ' return baselineValue;', ' } else {', ' return myVal + baselineValue;', ' }', ' }', ' ', ' public void setItem (int whichOne, double setToMe) throws OutOfBoundsException {', '', ' // make sure we are not out of bounds', ' if (whichOne >= myLength || whichOne < 0) {...
[]
Global_Variable 'nonEmptyEntries' used at line 382 is defined at line 300 and has a Long-Range dependency. Variable 'whichOne' used at line 382 is defined at line 374 and has a Short-Range dependency.
{}
{'Global_Variable Long-Range': 1, 'Variable Short-Range': 1}
completion_java
DoubleVectorTester
393
393
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.lang.Math;', 'import java.util.*;', '', '/**', ' * This abstract class serves as the basis from which all of the DoubleVector', ' * implementations should be extended. Most of the methods are abstract, but', ' * this class does provide imple...
[' if (whichOne >= myLength || whichOne < 0) {']
[' throw new OutOfBoundsException ("index too large in setItem");', ' }', ' ', ' // try to put the value in', ' nonEmptyEntries.put (whichOne, setToMe - baselineValue);', ' }', ' ', ' public int getLength () {', ' return myLength;', ' }', '}', '', '', '', '/**', ' * A JUnit test case class.', ' ...
[{'reason_category': 'If Condition', 'usage_line': 393}]
Variable 'whichOne' used at line 393 is defined at line 390 and has a Short-Range dependency. Global_Variable 'myLength' used at line 393 is defined at line 307 and has a Long-Range dependency.
{'If Condition': 1}
{'Variable Short-Range': 1, 'Global_Variable Long-Range': 1}
completion_java
DoubleVectorTester
398
398
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.lang.Math;', 'import java.util.*;', '', '/**', ' * This abstract class serves as the basis from which all of the DoubleVector', ' * implementations should be extended. Most of the methods are abstract, but', ' * this class does provide imple...
[' nonEmptyEntries.put (whichOne, setToMe - baselineValue);']
[' }', ' ', ' public int getLength () {', ' return myLength;', ' }', '}', '', '', '', '/**', ' * A JUnit test case class.', ' * Every method starting with the word "test" will be called when running', ' * the test with JUnit.', ' */', 'public class DoubleVectorTester extends TestCase {', ' ', ' /**', ' * In ...
[]
Global_Variable 'nonEmptyEntries' used at line 398 is defined at line 300 and has a Long-Range dependency. Variable 'whichOne' used at line 398 is defined at line 390 and has a Short-Range dependency. Variable 'setToMe' used at line 398 is defined at line 390 and has a Short-Range dependency. Global_Variable 'baselineV...
{}
{'Global_Variable Long-Range': 2, 'Variable Short-Range': 2}
completion_java
FactorizationTester
63
63
['import junit.framework.TestCase;', 'import java.io.ByteArrayOutputStream;', 'import java.io.PrintStream;', 'import java.lang.Math;', '', '/**', ' * This class implements a relatively simple algorithm for computing', ' * (and printing) the prime factors of a number. At initialization,', ' * a list of primes is comput...
[' if (numToFactorize % allPrimes[curPosInAllPrimes] == 0) {']
[' ', ' // if it\'s the first one, we don\'t need to print a "x"', ' // print the factor & reset the firstOne flag', ' if (firstOne) {', ' resultStream.format ("%d", allPrimes[curPosInAllPrimes]);', ' firstOne = false;', ' ', ' // otherwise, print the factor...
[{'reason_category': 'Loop Body', 'usage_line': 63}, {'reason_category': 'If Condition', 'usage_line': 63}]
Variable 'numToFactorize' used at line 63 is defined at line 34 and has a Medium-Range dependency. Global_Variable 'allPrimes' used at line 63 is defined at line 21 and has a Long-Range dependency. Variable 'curPosInAllPrimes' used at line 63 is defined at line 54 and has a Short-Range dependency.
{'Loop Body': 1, 'If Condition': 1}
{'Variable Medium-Range': 1, 'Global_Variable Long-Range': 1, 'Variable Short-Range': 1}
completion_java
FactorizationTester
68
69
['import junit.framework.TestCase;', 'import java.io.ByteArrayOutputStream;', 'import java.io.PrintStream;', 'import java.lang.Math;', '', '/**', ' * This class implements a relatively simple algorithm for computing', ' * (and printing) the prime factors of a number. At initialization,', ' * a list of primes is comput...
[' resultStream.format ("%d", allPrimes[curPosInAllPrimes]);', ' firstOne = false;']
[' ', ' // otherwise, print the factor pre-pended with an "x"', ' } else {', ' resultStream.format (" x %d", allPrimes[curPosInAllPrimes]);', ' }', ' ', ' // remove that prime factor from the target', ' numToFactorize /= allPrimes[curPosInAllPrimes];', ' ...
[{'reason_category': 'Loop Body', 'usage_line': 68}, {'reason_category': 'If Body', 'usage_line': 68}, {'reason_category': 'Loop Body', 'usage_line': 69}, {'reason_category': 'If Body', 'usage_line': 69}]
Global_Variable 'resultStream' used at line 68 is defined at line 27 and has a Long-Range dependency. Global_Variable 'allPrimes' used at line 68 is defined at line 21 and has a Long-Range dependency. Variable 'curPosInAllPrimes' used at line 68 is defined at line 54 and has a Medium-Range dependency. Variable 'firstOn...
{'Loop Body': 2, 'If Body': 2}
{'Global_Variable Long-Range': 2, 'Variable Medium-Range': 2}
completion_java
FactorizationTester
73
73
['import junit.framework.TestCase;', 'import java.io.ByteArrayOutputStream;', 'import java.io.PrintStream;', 'import java.lang.Math;', '', '/**', ' * This class implements a relatively simple algorithm for computing', ' * (and printing) the prime factors of a number. At initialization,', ' * a list of primes is comput...
[' resultStream.format (" x %d", allPrimes[curPosInAllPrimes]);']
[' }', ' ', ' // remove that prime factor from the target', ' numToFactorize /= allPrimes[curPosInAllPrimes];', ' ', ' // if the current prime does not divde evenly, try the next one', ' } else {', ' curPosInAllPrimes++;', ' }', ' }', ' ', ' // if we nev...
[{'reason_category': 'Loop Body', 'usage_line': 73}, {'reason_category': 'If Body', 'usage_line': 73}, {'reason_category': 'Else Reasoning', 'usage_line': 73}]
Global_Variable 'resultStream' used at line 73 is defined at line 27 and has a Long-Range dependency. Global_Variable 'allPrimes' used at line 73 is defined at line 21 and has a Long-Range dependency. Variable 'curPosInAllPrimes' used at line 73 is defined at line 54 and has a Medium-Range dependency.
{'Loop Body': 1, 'If Body': 1, 'Else Reasoning': 1}
{'Global_Variable Long-Range': 2, 'Variable Medium-Range': 1}
completion_java
FactorizationTester
77
77
['import junit.framework.TestCase;', 'import java.io.ByteArrayOutputStream;', 'import java.io.PrintStream;', 'import java.lang.Math;', '', '/**', ' * This class implements a relatively simple algorithm for computing', ' * (and printing) the prime factors of a number. At initialization,', ' * a list of primes is comput...
[' numToFactorize /= allPrimes[curPosInAllPrimes];']
[' ', ' // if the current prime does not divde evenly, try the next one', ' } else {', ' curPosInAllPrimes++;', ' }', ' }', ' ', ' // if we never printed any factors, then display the number itself', ' if (firstOne) {', ' resultStream.format ("%d", numToFactorize);', " /...
[{'reason_category': 'Loop Body', 'usage_line': 77}, {'reason_category': 'If Body', 'usage_line': 77}]
Global_Variable 'allPrimes' used at line 77 is defined at line 21 and has a Long-Range dependency. Variable 'curPosInAllPrimes' used at line 77 is defined at line 54 and has a Medium-Range dependency. Variable 'numToFactorize' used at line 77 is defined at line 34 and has a Long-Range dependency.
{'Loop Body': 1, 'If Body': 1}
{'Global_Variable Long-Range': 1, 'Variable Medium-Range': 1, 'Variable Long-Range': 1}
completion_java
FactorizationTester
81
81
['import junit.framework.TestCase;', 'import java.io.ByteArrayOutputStream;', 'import java.io.PrintStream;', 'import java.lang.Math;', '', '/**', ' * This class implements a relatively simple algorithm for computing', ' * (and printing) the prime factors of a number. At initialization,', ' * a list of primes is comput...
[' curPosInAllPrimes++;']
[' }', ' }', ' ', ' // if we never printed any factors, then display the number itself', ' if (firstOne) {', ' resultStream.format ("%d", numToFactorize);', " // Otherwsie print the factors connected by 'x'", ' } else if (numToFactorize > 1) {', ' resultStream.format (" x %d", numToFact...
[{'reason_category': 'Loop Body', 'usage_line': 81}, {'reason_category': 'Else Reasoning', 'usage_line': 81}]
Variable 'curPosInAllPrimes' used at line 81 is defined at line 54 and has a Medium-Range dependency.
{'Loop Body': 1, 'Else Reasoning': 1}
{'Variable Medium-Range': 1}
completion_java
FactorizationTester
87
87
['import junit.framework.TestCase;', 'import java.io.ByteArrayOutputStream;', 'import java.io.PrintStream;', 'import java.lang.Math;', '', '/**', ' * This class implements a relatively simple algorithm for computing', ' * (and printing) the prime factors of a number. At initialization,', ' * a list of primes is comput...
[' resultStream.format ("%d", numToFactorize);']
[" // Otherwsie print the factors connected by 'x'", ' } else if (numToFactorize > 1) {', ' resultStream.format (" x %d", numToFactorize);', ' }', ' }', ' ', ' ', ' /**', ' * This is the constructor. What it does is to fill the array allPrimes with all', ' * of the prime numbers from 2 through sq...
[{'reason_category': 'If Body', 'usage_line': 87}]
Global_Variable 'resultStream' used at line 87 is defined at line 27 and has a Long-Range dependency. Variable 'numToFactorize' used at line 87 is defined at line 77 and has a Short-Range dependency.
{'If Body': 1}
{'Global_Variable Long-Range': 1, 'Variable Short-Range': 1}
completion_java
FactorizationTester
89
91
['import junit.framework.TestCase;', 'import java.io.ByteArrayOutputStream;', 'import java.io.PrintStream;', 'import java.lang.Math;', '', '/**', ' * This class implements a relatively simple algorithm for computing', ' * (and printing) the prime factors of a number. At initialization,', ' * a list of primes is comput...
[' } else if (numToFactorize > 1) {', ' resultStream.format (" x %d", numToFactorize);', ' }']
[' }', ' ', ' ', ' /**', ' * This is the constructor. What it does is to fill the array allPrimes with all', ' * of the prime numbers from 2 through sqrt(maxNumberToFactorize). This array of primes', ' * can then subsequently be used by the printPrimeFactorization method to actually', ' * compute the prim...
[{'reason_category': 'Else Reasoning', 'usage_line': 89}, {'reason_category': 'Else Reasoning', 'usage_line': 90}, {'reason_category': 'Else Reasoning', 'usage_line': 91}]
Variable 'numToFactorize' used at line 89 is defined at line 77 and has a Medium-Range dependency. Global_Variable 'resultStream' used at line 90 is defined at line 27 and has a Long-Range dependency. Variable 'numToFactorize' used at line 90 is defined at line 77 and has a Medium-Range dependency.
{'Else Reasoning': 3}
{'Variable Medium-Range': 2, 'Global_Variable Long-Range': 1}
completion_java
FactorizationTester
111
112
['import junit.framework.TestCase;', 'import java.io.ByteArrayOutputStream;', 'import java.io.PrintStream;', 'import java.lang.Math;', '', '/**', ' * This class implements a relatively simple algorithm for computing', ' * (and printing) the prime factors of a number. At initialization,', ' * a list of primes is comput...
[' upperBound = (int) Math.ceil (Math.sqrt (maxNumberToFactorize));', ' allPrimes = new int[upperBound - 1];']
[' ', ' // numIntsInList is the number of ints currently in the list.', ' int numIntsInList = upperBound - 1;', ' ', ' // the number of primes so far is zero', ' numPrimes = 0;', ' ', ' // write all of the candidate numbers to the list... this is all of the numbers', ' // from two to upperBou...
[]
Library 'Math' used at line 111 is defined at line 4 and has a Long-Range dependency. Global_Variable 'maxNumberToFactorize' used at line 111 is defined at line 107 and has a Short-Range dependency. Global_Variable 'upperBound' used at line 111 is defined at line 15 and has a Long-Range dependency. Global_Variable 'upp...
{}
{'Library Long-Range': 1, 'Global_Variable Short-Range': 2, 'Global_Variable Long-Range': 2}
completion_java
FactorizationTester
115
115
['import junit.framework.TestCase;', 'import java.io.ByteArrayOutputStream;', 'import java.io.PrintStream;', 'import java.lang.Math;', '', '/**', ' * This class implements a relatively simple algorithm for computing', ' * (and printing) the prime factors of a number. At initialization,', ' * a list of primes is comput...
[' int numIntsInList = upperBound - 1;']
[' ', ' // the number of primes so far is zero', ' numPrimes = 0;', ' ', ' // write all of the candidate numbers to the list... this is all of the numbers', ' // from two to upperBound', ' for (int i = 0; i < upperBound - 1; i++) {', ' allPrimes[i] = i + 2;', ' }', ' ', ' // now we ke...
[]
Global_Variable 'upperBound' used at line 115 is defined at line 111 and has a Short-Range dependency.
{}
{'Global_Variable Short-Range': 1}
completion_java
FactorizationTester
123
124
['import junit.framework.TestCase;', 'import java.io.ByteArrayOutputStream;', 'import java.io.PrintStream;', 'import java.lang.Math;', '', '/**', ' * This class implements a relatively simple algorithm for computing', ' * (and printing) the prime factors of a number. At initialization,', ' * a list of primes is comput...
[' allPrimes[i] = i + 2;', ' }']
[' ', ' // now we keep removing numbers from the list until we have only primes', ' while (numIntsInList > numPrimes) {', ' ', ' // curPos tells us the last slot that has a "good" (still possibly prime) value.', ' int curPos = numPrimes + 1;', ' ', ' // the front of the list is a prime....
[{'reason_category': 'Loop Body', 'usage_line': 123}, {'reason_category': 'Loop Body', 'usage_line': 124}]
Variable 'i' used at line 123 is defined at line 122 and has a Short-Range dependency. Global_Variable 'allPrimes' used at line 123 is defined at line 112 and has a Medium-Range dependency.
{'Loop Body': 2}
{'Variable Short-Range': 1, 'Global_Variable Medium-Range': 1}
completion_java
FactorizationTester
130
130
['import junit.framework.TestCase;', 'import java.io.ByteArrayOutputStream;', 'import java.io.PrintStream;', 'import java.lang.Math;', '', '/**', ' * This class implements a relatively simple algorithm for computing', ' * (and printing) the prime factors of a number. At initialization,', ' * a list of primes is comput...
[' int curPos = numPrimes + 1;']
[' ', ' // the front of the list is a prime... kill everyone who is a multiple of it', ' for (int i = numPrimes + 1; i < numIntsInList; i++) {', ' ', ' // if the dude at position i is not a multiple of the current prime, then', " // we keep him; otherwise, he'll be lost", ' if ...
[{'reason_category': 'Loop Body', 'usage_line': 130}]
Global_Variable 'numPrimes' used at line 130 is defined at line 118 and has a Medium-Range dependency.
{'Loop Body': 1}
{'Global_Variable Medium-Range': 1}
completion_java
FactorizationTester
137
140
['import junit.framework.TestCase;', 'import java.io.ByteArrayOutputStream;', 'import java.io.PrintStream;', 'import java.lang.Math;', '', '/**', ' * This class implements a relatively simple algorithm for computing', ' * (and printing) the prime factors of a number. At initialization,', ' * a list of primes is comput...
[' if (allPrimes[i] % allPrimes[numPrimes] != 0) {', ' allPrimes[curPos] = allPrimes[i];', ' curPos++;', ' }']
[' }', ' ', ' // the number of ints in the list is now equal to the last slot we wrote a value to', ' numIntsInList = curPos;', ' ', ' // and the guy at the front of the list is now considered a prime', ' numPrimes++;', ' ', ' }', ' }', ' ', '', '}', '', '/**', ' * A JUnit t...
[{'reason_category': 'Loop Body', 'usage_line': 137}, {'reason_category': 'If Condition', 'usage_line': 137}, {'reason_category': 'Loop Body', 'usage_line': 138}, {'reason_category': 'If Body', 'usage_line': 138}, {'reason_category': 'Loop Body', 'usage_line': 139}, {'reason_category': 'If Body', 'usage_line': 139}, {'...
Global_Variable 'allPrimes' used at line 137 is defined at line 112 and has a Medium-Range dependency. Variable 'i' used at line 137 is defined at line 133 and has a Short-Range dependency. Global_Variable 'numPrimes' used at line 137 is defined at line 118 and has a Medium-Range dependency. Global_Variable 'allPrimes'...
{'Loop Body': 4, 'If Condition': 1, 'If Body': 3}
{'Global_Variable Medium-Range': 3, 'Variable Short-Range': 4}
completion_java
FactorizationTester
144
144
['import junit.framework.TestCase;', 'import java.io.ByteArrayOutputStream;', 'import java.io.PrintStream;', 'import java.lang.Math;', '', '/**', ' * This class implements a relatively simple algorithm for computing', ' * (and printing) the prime factors of a number. At initialization,', ' * a list of primes is comput...
[' numIntsInList = curPos;']
[' ', ' // and the guy at the front of the list is now considered a prime', ' numPrimes++;', ' ', ' }', ' }', ' ', '', '}', '', '/**', ' * A JUnit test case class.', ' * Every method starting with the word "test" will be called when running', ' * the test with JUnit.', ' */', ' ', 'public class...
[{'reason_category': 'Loop Body', 'usage_line': 144}]
Variable 'curPos' used at line 144 is defined at line 130 and has a Medium-Range dependency. Variable 'numIntsInList' used at line 144 is defined at line 115 and has a Medium-Range dependency.
{'Loop Body': 1}
{'Variable Medium-Range': 2}
completion_java
FactorizationTester
147
147
['import junit.framework.TestCase;', 'import java.io.ByteArrayOutputStream;', 'import java.io.PrintStream;', 'import java.lang.Math;', '', '/**', ' * This class implements a relatively simple algorithm for computing', ' * (and printing) the prime factors of a number. At initialization,', ' * a list of primes is comput...
[' numPrimes++;']
[' ', ' }', ' }', ' ', '', '}', '', '/**', ' * A JUnit test case class.', ' * Every method starting with the word "test" will be called when running', ' * the test with JUnit.', ' */', ' ', 'public class FactorizationTester extends TestCase {', ' /**', ' * Stream to hold the result of each test.', ' */...
[{'reason_category': 'Loop Body', 'usage_line': 147}]
Global_Variable 'numPrimes' used at line 147 is defined at line 118 and has a Medium-Range dependency.
{'Loop Body': 1}
{'Global_Variable Medium-Range': 1}
completion_java
FactorizationTester
196
197
['import junit.framework.TestCase;', 'import java.io.ByteArrayOutputStream;', 'import java.io.PrintStream;', 'import java.lang.Math;', '', '/**', ' * This class implements a relatively simple algorithm for computing', ' * (and printing) the prime factors of a number. At initialization,', ' * a list of primes is comput...
[' PrimeFactorizer myFactorizerMax100 = new PrimeFactorizer(100, outputStream);', ' myFactorizerMax100.printPrimeFactorization (1);']
['', ' // Print Results', ' String expected = new String("Prime factorization of 1 is: 1");', ' printInfo("Factorizing 1 using max 100", expected, result.toString());', '', ' // Check if test passed by comparing the expected and actual results', ' assertEquals (expected, result.toString());', ' }', '', ...
[]
Class 'PrimeFactorizer' used at line 196 is defined at line 12 and has a Long-Range dependency. Global_Variable 'outputStream' used at line 196 is defined at line 170 and has a Medium-Range dependency. Function 'PrimeFactorizer.printPrimeFactorization' used at line 197 is defined at line 34 and has a Long-Range depende...
{}
{'Class Long-Range': 1, 'Global_Variable Medium-Range': 1, 'Function Long-Range': 1}
completion_java
FactorizationTester
204
204
['import junit.framework.TestCase;', 'import java.io.ByteArrayOutputStream;', 'import java.io.PrintStream;', 'import java.lang.Math;', '', '/**', ' * This class implements a relatively simple algorithm for computing', ' * (and printing) the prime factors of a number. At initialization,', ' * a list of primes is comput...
[' assertEquals (expected, result.toString());']
[' }', '', ' // Test the factorization of 7 ', ' public void test100MaxFactorize7() {', ' // Factorize the number', ' PrimeFactorizer myFactorizerMax100 = new PrimeFactorizer(100, outputStream);', ' myFactorizerMax100.printPrimeFactorization (7);', '', ' // Print Results', ' String expected = new Stri...
[]
Variable 'expected' used at line 204 is defined at line 200 and has a Short-Range dependency. Global_Variable 'result' used at line 204 is defined at line 165 and has a Long-Range dependency.
{}
{'Variable Short-Range': 1, 'Global_Variable Long-Range': 1}
completion_java
FactorizationTester
209
219
['import junit.framework.TestCase;', 'import java.io.ByteArrayOutputStream;', 'import java.io.PrintStream;', 'import java.lang.Math;', '', '/**', ' * This class implements a relatively simple algorithm for computing', ' * (and printing) the prime factors of a number. At initialization,', ' * a list of primes is comput...
[' // Factorize the number', ' PrimeFactorizer myFactorizerMax100 = new PrimeFactorizer(100, outputStream);', ' myFactorizerMax100.printPrimeFactorization (7);', '', ' // Print Results', ' String expected = new String("Prime factorization of 7 is: 7");', ' printInfo("Factorizing 7 using max 100", expe...
['', ' // Test the factorization of 5', ' public void test100MaxFactorize5() {', ' // Factorize the number', ' PrimeFactorizer myFactorizerMax100 = new PrimeFactorizer(100, outputStream);', ' myFactorizerMax100.printPrimeFactorization (5);', '', ' // Print Results', ' String expected = new String("Prim...
[]
Class 'PrimeFactorizer' used at line 210 is defined at line 12 and has a Long-Range dependency. Global_Variable 'outputStream' used at line 210 is defined at line 170 and has a Long-Range dependency. Function 'PrimeFactorizer.printPrimeFactorization' used at line 211 is defined at line 34 and has a Long-Range dependenc...
{}
{'Class Long-Range': 1, 'Global_Variable Long-Range': 3, 'Function Long-Range': 2, 'Variable Short-Range': 2}
completion_java
FactorizationTester
223
233
['import junit.framework.TestCase;', 'import java.io.ByteArrayOutputStream;', 'import java.io.PrintStream;', 'import java.lang.Math;', '', '/**', ' * This class implements a relatively simple algorithm for computing', ' * (and printing) the prime factors of a number. At initialization,', ' * a list of primes is comput...
[' // Factorize the number', ' PrimeFactorizer myFactorizerMax100 = new PrimeFactorizer(100, outputStream);', ' myFactorizerMax100.printPrimeFactorization (5);', '', ' // Print Results', ' String expected = new String("Prime factorization of 5 is: 5");', ' printInfo("Factorizing 5 using max 100", expe...
[' ', ' // Test the factorization of 30', ' public void test100MaxFactorize30() {', ' // Factorize the number', ' PrimeFactorizer myFactorizerMax100 = new PrimeFactorizer(100, outputStream);', ' myFactorizerMax100.printPrimeFactorization (30);', '', ' // Print Results', ' String expected = new String...
[]
Class 'PrimeFactorizer' used at line 224 is defined at line 12 and has a Long-Range dependency. Global_Variable 'outputStream' used at line 224 is defined at line 170 and has a Long-Range dependency. Function 'PrimeFactorizer.printPrimeFactorization' used at line 225 is defined at line 34 and has a Long-Range dependenc...
{}
{'Class Long-Range': 1, 'Global_Variable Long-Range': 3, 'Function Long-Range': 2, 'Variable Short-Range': 2}
completion_java
FactorizationTester
237
247
['import junit.framework.TestCase;', 'import java.io.ByteArrayOutputStream;', 'import java.io.PrintStream;', 'import java.lang.Math;', '', '/**', ' * This class implements a relatively simple algorithm for computing', ' * (and printing) the prime factors of a number. At initialization,', ' * a list of primes is comput...
[' // Factorize the number', ' PrimeFactorizer myFactorizerMax100 = new PrimeFactorizer(100, outputStream);', ' myFactorizerMax100.printPrimeFactorization (30);', '', ' // Print Results', ' String expected = new String("Prime factorization of 30 is: 2 x 3 x 5");', ' printInfo("Factorizing 30 using max...
['', ' // Test the factorization of 81', ' public void test100MaxFactorize81() {', ' // Factorize the number', ' PrimeFactorizer myFactorizerMax100 = new PrimeFactorizer(100, outputStream);', ' myFactorizerMax100.printPrimeFactorization (81);', '', ' // Print Results', ' String expected = new String("P...
[]
Class 'PrimeFactorizer' used at line 238 is defined at line 12 and has a Long-Range dependency. Global_Variable 'outputStream' used at line 238 is defined at line 170 and has a Long-Range dependency. Function 'PrimeFactorizer.printPrimeFactorization' used at line 239 is defined at line 34 and has a Long-Range dependenc...
{}
{'Class Long-Range': 1, 'Global_Variable Long-Range': 3, 'Function Long-Range': 2, 'Variable Short-Range': 2}
completion_java
FactorizationTester
251
261
['import junit.framework.TestCase;', 'import java.io.ByteArrayOutputStream;', 'import java.io.PrintStream;', 'import java.lang.Math;', '', '/**', ' * This class implements a relatively simple algorithm for computing', ' * (and printing) the prime factors of a number. At initialization,', ' * a list of primes is comput...
[' // Factorize the number', ' PrimeFactorizer myFactorizerMax100 = new PrimeFactorizer(100, outputStream);', ' myFactorizerMax100.printPrimeFactorization (81);', '', ' // Print Results', ' String expected = new String("Prime factorization of 81 is: 3 x 3 x 3 x 3");', ' printInfo("Factorizing 81 using...
[' ', ' // Test the factorization of 71', ' public void test100MaxFactorize71() {', ' // Factorize the number', ' PrimeFactorizer myFactorizerMax100 = new PrimeFactorizer(100, outputStream);', ' myFactorizerMax100.printPrimeFactorization (71);', '', ' // Print Results', ' String expected = new String(...
[]
Class 'PrimeFactorizer' used at line 252 is defined at line 12 and has a Long-Range dependency. Global_Variable 'outputStream' used at line 252 is defined at line 170 and has a Long-Range dependency. Function 'PrimeFactorizer.printPrimeFactorization' used at line 253 is defined at line 34 and has a Long-Range dependenc...
{}
{'Class Long-Range': 1, 'Global_Variable Long-Range': 3, 'Function Long-Range': 2, 'Variable Short-Range': 2}
completion_java
FactorizationTester
265
275
['import junit.framework.TestCase;', 'import java.io.ByteArrayOutputStream;', 'import java.io.PrintStream;', 'import java.lang.Math;', '', '/**', ' * This class implements a relatively simple algorithm for computing', ' * (and printing) the prime factors of a number. At initialization,', ' * a list of primes is comput...
[' // Factorize the number', ' PrimeFactorizer myFactorizerMax100 = new PrimeFactorizer(100, outputStream);', ' myFactorizerMax100.printPrimeFactorization (71);', '', ' // Print Results', ' String expected = new String("Prime factorization of 71 is: 71");', ' printInfo("Factorizing 71 using max 100", ...
[' ', ' // Test the factorization of 100', ' public void test100MaxFactorize100() {', ' // Factorize the number', ' PrimeFactorizer myFactorizerMax100 = new PrimeFactorizer(100, outputStream);', ' myFactorizerMax100.printPrimeFactorization (100);', '', ' // Print Results', ' String expected = new Stri...
[]
Class 'PrimeFactorizer' used at line 266 is defined at line 12 and has a Long-Range dependency. Global_Variable 'outputStream' used at line 266 is defined at line 170 and has a Long-Range dependency. Function 'PrimeFactorizer.printPrimeFactorization' used at line 267 is defined at line 34 and has a Long-Range dependenc...
{}
{'Class Long-Range': 1, 'Global_Variable Long-Range': 3, 'Function Long-Range': 2, 'Variable Short-Range': 2}
completion_java
FactorizationTester
279
289
['import junit.framework.TestCase;', 'import java.io.ByteArrayOutputStream;', 'import java.io.PrintStream;', 'import java.lang.Math;', '', '/**', ' * This class implements a relatively simple algorithm for computing', ' * (and printing) the prime factors of a number. At initialization,', ' * a list of primes is comput...
[' // Factorize the number', ' PrimeFactorizer myFactorizerMax100 = new PrimeFactorizer(100, outputStream);', ' myFactorizerMax100.printPrimeFactorization (100);', '', ' // Print Results', ' String expected = new String("Prime factorization of 100 is: 2 x 2 x 5 x 5");', ' printInfo("Factorizing 100 us...
[' ', ' // Test the factorization of 101', ' public void test100MaxFactorize101() {', ' // Factorize the number', ' PrimeFactorizer myFactorizerMax100 = new PrimeFactorizer(100, outputStream);', ' myFactorizerMax100.printPrimeFactorization (101);', '', ' // Print Results', ' String expected = new Stri...
[]
Class 'PrimeFactorizer' used at line 280 is defined at line 12 and has a Long-Range dependency. Global_Variable 'outputStream' used at line 280 is defined at line 170 and has a Long-Range dependency. Function 'PrimeFactorizer.printPrimeFactorization' used at line 281 is defined at line 34 and has a Long-Range dependenc...
{}
{'Class Long-Range': 1, 'Global_Variable Long-Range': 3, 'Function Long-Range': 2, 'Variable Short-Range': 2}
completion_java
FactorizationTester
293
295
['import junit.framework.TestCase;', 'import java.io.ByteArrayOutputStream;', 'import java.io.PrintStream;', 'import java.lang.Math;', '', '/**', ' * This class implements a relatively simple algorithm for computing', ' * (and printing) the prime factors of a number. At initialization,', ' * a list of primes is comput...
[' // Factorize the number', ' PrimeFactorizer myFactorizerMax100 = new PrimeFactorizer(100, outputStream);', ' myFactorizerMax100.printPrimeFactorization (101);']
['', ' // Print Results', ' String expected = new String("101 is too large to factorize");', ' printInfo("Factorizing 101 using max 100", expected, result.toString());', '', ' // Check if test passed', ' assertEquals (expected, result.toString());', ' }', ' ', ' // Test the factorization of 0', ' pub...
[]
Class 'PrimeFactorizer' used at line 294 is defined at line 12 and has a Long-Range dependency. Global_Variable 'outputStream' used at line 294 is defined at line 170 and has a Long-Range dependency. Function 'PrimeFactorizer.printPrimeFactorization' used at line 295 is defined at line 34 and has a Long-Range dependenc...
{}
{'Class Long-Range': 1, 'Global_Variable Long-Range': 1, 'Function Long-Range': 1}
completion_java
FactorizationTester
307
309
['import junit.framework.TestCase;', 'import java.io.ByteArrayOutputStream;', 'import java.io.PrintStream;', 'import java.lang.Math;', '', '/**', ' * This class implements a relatively simple algorithm for computing', ' * (and printing) the prime factors of a number. At initialization,', ' * a list of primes is comput...
[' // Factorize the number', ' PrimeFactorizer myFactorizerMax100 = new PrimeFactorizer(100, outputStream);', ' myFactorizerMax100.printPrimeFactorization (0);']
['', ' // Print Results', ' String expected = new String("Can\'t factorize a number less than 1");', ' printInfo("Factorizing 0 using max 100", expected, result.toString());', '', ' // Check if test passed', ' assertEquals (expected, result.toString());', ' }', ' // Test the factorization of 97', ' pu...
[]
Class 'PrimeFactorizer' used at line 308 is defined at line 12 and has a Long-Range dependency. Global_Variable 'outputStream' used at line 308 is defined at line 170 and has a Long-Range dependency. Function 'PrimeFactorizer.printPrimeFactorization' used at line 309 is defined at line 34 and has a Long-Range dependenc...
{}
{'Class Long-Range': 1, 'Global_Variable Long-Range': 1, 'Function Long-Range': 1}
completion_java
FactorizationTester
320
322
['import junit.framework.TestCase;', 'import java.io.ByteArrayOutputStream;', 'import java.io.PrintStream;', 'import java.lang.Math;', '', '/**', ' * This class implements a relatively simple algorithm for computing', ' * (and printing) the prime factors of a number. At initialization,', ' * a list of primes is comput...
[' // Factorize the number', ' PrimeFactorizer myFactorizerMax100 = new PrimeFactorizer(100, outputStream);', ' myFactorizerMax100.printPrimeFactorization (97);']
['', ' // Print Results', ' String expected = new String("Prime factorization of 97 is: 97");', ' printInfo("Factorizing 97 using max 100", expected, result.toString());', '', ' // Check if test passed', ' assertEquals (expected, result.toString());', ' }', '', ' // Test the factorization of 34534', ' ...
[]
Class 'PrimeFactorizer' used at line 321 is defined at line 12 and has a Long-Range dependency. Global_Variable 'outputStream' used at line 321 is defined at line 170 and has a Long-Range dependency. Function 'PrimeFactorizer.printPrimeFactorization' used at line 322 is defined at line 34 and has a Long-Range dependenc...
{}
{'Class Long-Range': 1, 'Global_Variable Long-Range': 1, 'Function Long-Range': 1}
completion_java
FactorizationTester
335
345
['import junit.framework.TestCase;', 'import java.io.ByteArrayOutputStream;', 'import java.io.PrintStream;', 'import java.lang.Math;', '', '/**', ' * This class implements a relatively simple algorithm for computing', ' * (and printing) the prime factors of a number. At initialization,', ' * a list of primes is comput...
[' // Factorize the number', ' PrimeFactorizer myFactorizerMax100000000 = new PrimeFactorizer(100000000, outputStream);', ' myFactorizerMax100000000.printPrimeFactorization (34534);', '', ' // Print Results', ' String expected = new String("Prime factorization of 34534 is: 2 x 31 x 557");', ' printInf...
['', ' // Test the factorization of 4339', ' // factorize numbers up to 100000000', ' public void test100000000MaxFactorize4339() {', ' // Factorize the number', ' PrimeFactorizer myFactorizerMax100000000 = new PrimeFactorizer(100000000, outputStream);', ' myFactorizerMax100000000.printPrimeFactorization (4...
[]
Class 'PrimeFactorizer' used at line 336 is defined at line 12 and has a Long-Range dependency. Global_Variable 'outputStream' used at line 336 is defined at line 170 and has a Long-Range dependency. Function 'PrimeFactorizer.printPrimeFactorization' used at line 337 is defined at line 34 and has a Long-Range dependenc...
{}
{'Class Long-Range': 1, 'Global_Variable Long-Range': 3, 'Function Long-Range': 2, 'Variable Short-Range': 2}
completion_java
FactorizationTester
350
360
['import junit.framework.TestCase;', 'import java.io.ByteArrayOutputStream;', 'import java.io.PrintStream;', 'import java.lang.Math;', '', '/**', ' * This class implements a relatively simple algorithm for computing', ' * (and printing) the prime factors of a number. At initialization,', ' * a list of primes is comput...
[' // Factorize the number', ' PrimeFactorizer myFactorizerMax100000000 = new PrimeFactorizer(100000000, outputStream);', ' myFactorizerMax100000000.printPrimeFactorization (4339);', '', ' // Print Results', ' String expected = new String("Prime factorization of 4339 is: 4339");', ' printInfo("Factori...
['', ' // Test the factorization of 65536', ' // factorize numbers up to 100000000', ' public void test100000000MaxFactorize65536() {', ' // Factorize the number', ' PrimeFactorizer myFactorizerMax100000000 = new PrimeFactorizer(100000000, outputStream);', ' myFactorizerMax100000000.printPrimeFactorization ...
[]
Class 'PrimeFactorizer' used at line 351 is defined at line 12 and has a Long-Range dependency. Global_Variable 'outputStream' used at line 351 is defined at line 170 and has a Long-Range dependency. Function 'PrimeFactorizer.printPrimeFactorization' used at line 352 is defined at line 34 and has a Long-Range dependenc...
{}
{'Class Long-Range': 1, 'Global_Variable Long-Range': 3, 'Function Long-Range': 2, 'Variable Short-Range': 2}
completion_java
FactorizationTester
365
375
['import junit.framework.TestCase;', 'import java.io.ByteArrayOutputStream;', 'import java.io.PrintStream;', 'import java.lang.Math;', '', '/**', ' * This class implements a relatively simple algorithm for computing', ' * (and printing) the prime factors of a number. At initialization,', ' * a list of primes is comput...
[' // Factorize the number', ' PrimeFactorizer myFactorizerMax100000000 = new PrimeFactorizer(100000000, outputStream);', ' myFactorizerMax100000000.printPrimeFactorization (65536);', '', ' // Print Results', ' String expected = new String("Prime factorization of 65536 is: 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x...
[' ', ' // Test the factorization of 99797', ' // factorize numbers up to 100000000', ' public void test100000000MaxFactorize99797() {', ' // Factorize the number', ' PrimeFactorizer myFactorizerMax100000000 = new PrimeFactorizer(100000000, outputStream);', ' myFactorizerMax100000000.printPrimeFactorizatio...
[]
Class 'PrimeFactorizer' used at line 366 is defined at line 12 and has a Long-Range dependency. Global_Variable 'outputStream' used at line 366 is defined at line 170 and has a Long-Range dependency. Function 'PrimeFactorizer.printPrimeFactorization' used at line 367 is defined at line 34 and has a Long-Range dependenc...
{}
{'Class Long-Range': 1, 'Global_Variable Long-Range': 3, 'Function Long-Range': 2, 'Variable Short-Range': 2}
completion_java
FactorizationTester
380
390
['import junit.framework.TestCase;', 'import java.io.ByteArrayOutputStream;', 'import java.io.PrintStream;', 'import java.lang.Math;', '', '/**', ' * This class implements a relatively simple algorithm for computing', ' * (and printing) the prime factors of a number. At initialization,', ' * a list of primes is comput...
[' // Factorize the number', ' PrimeFactorizer myFactorizerMax100000000 = new PrimeFactorizer(100000000, outputStream);', ' myFactorizerMax100000000.printPrimeFactorization (99797);', '', ' // Print Results', ' String expected = new String("Prime factorization of 99797 is: 23 x 4339");', ' printInfo("...
[' ', ' // Test the factorization of 307', ' // factorize numbers up to 100000000', ' public void test100000000MaxFactorize307() {', ' // Factorize the number', ' PrimeFactorizer myFactorizerMax100000000 = new PrimeFactorizer(100000000, outputStream);', ' myFactorizerMax100000000.printPrimeFactorization (3...
[]
Class 'PrimeFactorizer' used at line 381 is defined at line 12 and has a Long-Range dependency. Global_Variable 'outputStream' used at line 381 is defined at line 170 and has a Long-Range dependency. Function 'PrimeFactorizer.printPrimeFactorization' used at line 382 is defined at line 34 and has a Long-Range dependenc...
{}
{'Class Long-Range': 1, 'Global_Variable Long-Range': 3, 'Function Long-Range': 2, 'Variable Short-Range': 2}
completion_java
FactorizationTester
395
405
['import junit.framework.TestCase;', 'import java.io.ByteArrayOutputStream;', 'import java.io.PrintStream;', 'import java.lang.Math;', '', '/**', ' * This class implements a relatively simple algorithm for computing', ' * (and printing) the prime factors of a number. At initialization,', ' * a list of primes is comput...
[' // Factorize the number', ' PrimeFactorizer myFactorizerMax100000000 = new PrimeFactorizer(100000000, outputStream);', ' myFactorizerMax100000000.printPrimeFactorization (307);', '', ' // Print Results', ' String expected = new String("Prime factorization of 307 is: 307");', ' printInfo("Factorizin...
['', ' // Test the factorization of 38845248344', ' // factorize numbers up to 100000000000', ' public void test100000000000MaxFactorize38845248344() {', ' // Factorize the number', ' PrimeFactorizer myFactorizerMax100000000000 = new PrimeFactorizer(100000000000L, outputStream);', ' myFactorizerMax100000000...
[]
Class 'PrimeFactorizer' used at line 396 is defined at line 12 and has a Long-Range dependency. Global_Variable 'outputStream' used at line 396 is defined at line 170 and has a Long-Range dependency. Function 'PrimeFactorizer.printPrimeFactorization' used at line 397 is defined at line 34 and has a Long-Range dependenc...
{}
{'Class Long-Range': 1, 'Global_Variable Long-Range': 3, 'Function Long-Range': 2, 'Variable Short-Range': 2}
completion_java
FactorizationTester
410
419
['import junit.framework.TestCase;', 'import java.io.ByteArrayOutputStream;', 'import java.io.PrintStream;', 'import java.lang.Math;', '', '/**', ' * This class implements a relatively simple algorithm for computing', ' * (and printing) the prime factors of a number. At initialization,', ' * a list of primes is comput...
[' // Factorize the number', ' PrimeFactorizer myFactorizerMax100000000000 = new PrimeFactorizer(100000000000L, outputStream);', ' myFactorizerMax100000000000.printPrimeFactorization (38845248344L);', '', ' // Print Results', ' String expected = new String("Prime factorization of 38845248344 is: 2 x 2 x ...
[' ', ' result.reset ();', ' myFactorizerMax100000000000.printPrimeFactorization (24210833220L);', ' expected = new String("Prime factorization of 24210833220 is: 2 x 2 x 3 x 3 x 5 x 7 x 17 x 19 x 19 x 31 x 101");', ' printInfo("Factorizing 24210833220 using max 100000000000", expected, result.toString()...
[]
Class 'PrimeFactorizer' used at line 411 is defined at line 12 and has a Long-Range dependency. Global_Variable 'outputStream' used at line 411 is defined at line 170 and has a Long-Range dependency. Function 'PrimeFactorizer.printPrimeFactorization' used at line 412 is defined at line 34 and has a Long-Range dependenc...
{}
{'Class Long-Range': 1, 'Global_Variable Long-Range': 3, 'Function Long-Range': 2, 'Variable Short-Range': 2}
completion_java
FactorizationTester
452
453
['import junit.framework.TestCase;', 'import java.io.ByteArrayOutputStream;', 'import java.io.PrintStream;', 'import java.lang.Math;', '', '/**', ' * This class implements a relatively simple algorithm for computing', ' * (and printing) the prime factors of a number. At initialization,', ' * a list of primes is comput...
[' String expected = new String("Prime factorization of 38845248344 is: 2 x 2 x 2 x 7 x 693665149"); ', ' assertEquals (expected, result.toString());']
[' }', ' }', ' ', ' // if we make it here, we pass the test', ' assertTrue (true);', ' }', ' ', '}']
[{'reason_category': 'Loop Body', 'usage_line': 452}, {'reason_category': 'If Body', 'usage_line': 452}, {'reason_category': 'Loop Body', 'usage_line': 453}, {'reason_category': 'If Body', 'usage_line': 453}]
Variable 'expected' used at line 453 is defined at line 452 and has a Short-Range dependency. Global_Variable 'result' used at line 453 is defined at line 165 and has a Long-Range dependency.
{'Loop Body': 2, 'If Body': 2}
{'Variable Short-Range': 1, 'Global_Variable Long-Range': 1}
completion_java
CounterTester
75
77
['import junit.framework.TestCase;', 'import java.io.*;', 'import java.util.HashMap;', 'import java.util.TreeMap;', 'import java.util.ArrayList;', '', '/**', ' * This silly little class wraps String, int pairs so they can be sorted.', ' * Used by the WordCounter class.', ' */', 'class WordWrapper implements Comparable ...
[' if (w.myCount == myCount) {', ' return myWord.compareTo(w.myWord);', ' }']
[" // If the counts are not equal, subtract the count of the current word from the count of the word 'w'", ' return w.myCount - myCount;', ' }', '}', '', '', '/**', ' * This class is used to count occurences of words (strings) in a corpus. Used by', ' * the IndexedDocumentCollection class to find the most frequ...
[{'reason_category': 'If Condition', 'usage_line': 75}, {'reason_category': 'If Body', 'usage_line': 76}, {'reason_category': 'If Body', 'usage_line': 77}]
Variable 'w' used at line 75 is defined at line 72 and has a Short-Range dependency. Global_Variable 'myCount' used at line 75 is defined at line 14 and has a Long-Range dependency. Global_Variable 'myWord' used at line 76 is defined at line 13 and has a Long-Range dependency. Variable 'w' used at line 76 is defined at...
{'If Condition': 1, 'If Body': 2}
{'Variable Short-Range': 2, 'Global_Variable Long-Range': 2}
completion_java
CounterTester
79
79
['import junit.framework.TestCase;', 'import java.io.*;', 'import java.util.HashMap;', 'import java.util.TreeMap;', 'import java.util.ArrayList;', '', '/**', ' * This silly little class wraps String, int pairs so they can be sorted.', ' * Used by the WordCounter class.', ' */', 'class WordWrapper implements Comparable ...
[' return w.myCount - myCount;']
[' }', '}', '', '', '/**', ' * This class is used to count occurences of words (strings) in a corpus. Used by', ' * the IndexedDocumentCollection class to find the most frequent words in the corpus.', ' */', '', 'class WordCounter {', ' ', " // this is the map that holds (for each word) the number of times we've ...
[]
Variable 'w' used at line 79 is defined at line 72 and has a Short-Range dependency. Global_Variable 'myCount' used at line 79 is defined at line 14 and has a Long-Range dependency.
{}
{'Variable Short-Range': 1, 'Global_Variable Long-Range': 1}
completion_java
CounterTester
107
110
['import junit.framework.TestCase;', 'import java.io.*;', 'import java.util.HashMap;', 'import java.util.TreeMap;', 'import java.util.ArrayList;', '', '/**', ' * This silly little class wraps String, int pairs so they can be sorted.', ' * Used by the WordCounter class.', ' */', 'class WordWrapper implements Comparable ...
[' ones.remove (addMe);', ' WordWrapper temp = new WordWrapper (addMe, 1, extractedWords.size ());', ' wordsIHaveSeen.put(addMe, temp);', ' extractedWords.add (temp);']
[' }', '', ' // first check to see if the word is alredy in wordsIHaveSeen', ' if (wordsIHaveSeen.containsKey (addMe)) {', ' // if it is, then remove and increment its count', ' WordWrapper temp = wordsIHaveSeen.get (addMe);', ' temp.incCount ();', '', ' // find the slot that we go to in th...
[{'reason_category': 'If Body', 'usage_line': 107}, {'reason_category': 'If Body', 'usage_line': 108}, {'reason_category': 'If Body', 'usage_line': 109}, {'reason_category': 'If Body', 'usage_line': 110}]
Global_Variable 'ones' used at line 107 is defined at line 94 and has a Medium-Range dependency. Variable 'addMe' used at line 107 is defined at line 105 and has a Short-Range dependency. Class 'WordWrapper' used at line 108 is defined at line 11 and has a Long-Range dependency. Variable 'addMe' used at line 108 is def...
{'If Body': 4}
{'Global_Variable Medium-Range': 4, 'Variable Short-Range': 5, 'Class Long-Range': 1}
completion_java
CounterTester
114
114
['import junit.framework.TestCase;', 'import java.io.*;', 'import java.util.HashMap;', 'import java.util.TreeMap;', 'import java.util.ArrayList;', '', '/**', ' * This silly little class wraps String, int pairs so they can be sorted.', ' * Used by the WordCounter class.', ' */', 'class WordWrapper implements Comparable ...
[' if (wordsIHaveSeen.containsKey (addMe)) {']
[' // if it is, then remove and increment its count', ' WordWrapper temp = wordsIHaveSeen.get (addMe);', ' temp.incCount ();', '', ' // find the slot that we go to in the extractedWords list', " // by sorting the 'extractedWords' list in ascending order", ' for (int i = temp.getPos () - 1;...
[{'reason_category': 'If Condition', 'usage_line': 114}]
Global_Variable 'wordsIHaveSeen' used at line 114 is defined at line 93 and has a Medium-Range dependency. Variable 'addMe' used at line 114 is defined at line 105 and has a Short-Range dependency.
{'If Condition': 1}
{'Global_Variable Medium-Range': 1, 'Variable Short-Range': 1}
completion_java
CounterTester
116
117
['import junit.framework.TestCase;', 'import java.io.*;', 'import java.util.HashMap;', 'import java.util.TreeMap;', 'import java.util.ArrayList;', '', '/**', ' * This silly little class wraps String, int pairs so they can be sorted.', ' * Used by the WordCounter class.', ' */', 'class WordWrapper implements Comparable ...
[' WordWrapper temp = wordsIHaveSeen.get (addMe);', ' temp.incCount ();']
['', ' // find the slot that we go to in the extractedWords list', " // by sorting the 'extractedWords' list in ascending order", ' for (int i = temp.getPos () - 1; i >= 0 && ', ' extractedWords.get (i).compareTo (extractedWords.get (i + 1)) > 0; i--) {', ' temp = extractedWords.get (i + 1)...
[{'reason_category': 'If Body', 'usage_line': 116}, {'reason_category': 'If Body', 'usage_line': 117}]
Class 'WordWrapper' used at line 116 is defined at line 11 and has a Long-Range dependency. Global_Variable 'wordsIHaveSeen' used at line 116 is defined at line 93 and has a Medium-Range dependency. Variable 'addMe' used at line 116 is defined at line 105 and has a Medium-Range dependency. Variable 'temp' used at line ...
{'If Body': 2}
{'Class Long-Range': 1, 'Global_Variable Medium-Range': 1, 'Variable Medium-Range': 1, 'Variable Short-Range': 1}
completion_java
CounterTester
122
131
['import junit.framework.TestCase;', 'import java.io.*;', 'import java.util.HashMap;', 'import java.util.TreeMap;', 'import java.util.ArrayList;', '', '/**', ' * This silly little class wraps String, int pairs so they can be sorted.', ' * Used by the WordCounter class.', ' */', 'class WordWrapper implements Comparable ...
[' extractedWords.get (i).compareTo (extractedWords.get (i + 1)) > 0; i--) {', ' temp = extractedWords.get (i + 1);', ' temp.setPos (i);', ' ', ' WordWrapper temp2 = extractedWords.get (i);', ' temp2.setPos (i + 1);', ' ', ' extractedWords.set (i + 1, temp2);', ' ...
['', ' // in this case it is not there, so just add it', ' } else {', ' ones.put (addMe, addMe);', ' }', ' }', '', ' /**', ' * Returns the kth most frequent word in the corpus so far. A deep copy is returned,', ' * so no aliasing is possible. Returns null if there are not enough words.', ' *', '...
[{'reason_category': 'If Body', 'usage_line': 122}, {'reason_category': 'Loop Body', 'usage_line': 122}, {'reason_category': 'If Body', 'usage_line': 123}, {'reason_category': 'Loop Body', 'usage_line': 123}, {'reason_category': 'If Body', 'usage_line': 124}, {'reason_category': 'Loop Body', 'usage_line': 124}, {'reaso...
Global_Variable 'extractedWords' used at line 122 is defined at line 97 and has a Medium-Range dependency. Variable 'i' used at line 122 is defined at line 121 and has a Short-Range dependency. Function 'compareTo' used at line 122 is defined at line 72 and has a Long-Range dependency. Global_Variable 'extractedWords' ...
{'If Body': 10, 'Loop Body': 10}
{'Global_Variable Medium-Range': 3, 'Variable Short-Range': 12, 'Function Long-Range': 1, 'Class Long-Range': 1, 'Global_Variable Long-Range': 2}
completion_java
CounterTester
135
135
['import junit.framework.TestCase;', 'import java.io.*;', 'import java.util.HashMap;', 'import java.util.TreeMap;', 'import java.util.ArrayList;', '', '/**', ' * This silly little class wraps String, int pairs so they can be sorted.', ' * Used by the WordCounter class.', ' */', 'class WordWrapper implements Comparable ...
[' ones.put (addMe, addMe);']
[' }', ' }', '', ' /**', ' * Returns the kth most frequent word in the corpus so far. A deep copy is returned,', ' * so no aliasing is possible. Returns null if there are not enough words.', ' *', ' * @param k Note that the most frequent word is at k = 0', ' * @return The kth most frequent wor...
[{'reason_category': 'Else Reasoning', 'usage_line': 135}]
Global_Variable 'ones' used at line 135 is defined at line 94 and has a Long-Range dependency. Variable 'addMe' used at line 135 is defined at line 105 and has a Medium-Range dependency.
{'Else Reasoning': 1}
{'Global_Variable Long-Range': 1, 'Variable Medium-Range': 1}
completion_java
CounterTester
150
156
['import junit.framework.TestCase;', 'import java.io.*;', 'import java.util.HashMap;', 'import java.util.TreeMap;', 'import java.util.ArrayList;', '', '/**', ' * This silly little class wraps String, int pairs so they can be sorted.', ' * Used by the WordCounter class.', ' */', 'class WordWrapper implements Comparable ...
[' int which = extractedWords.size ();', ' for (String s : ones.navigableKeySet ()) {', ' if (which == k)', ' return s;', ' which++;', ' }', ' return null;']
[' } else {', ' // If k is less than the size of the extractedWords list,', ' // return the kth most frequent word from extractedWords', ' return extractedWords.get (k).extractWord ();', ' }', ' }', '}', '/**', ' * A JUnit test case class.', ' * Every method starting with the word "test" will be c...
[{'reason_category': 'If Body', 'usage_line': 150}, {'reason_category': 'If Body', 'usage_line': 151}, {'reason_category': 'Define Stop Criteria', 'usage_line': 151}, {'reason_category': 'Loop Body', 'usage_line': 152}, {'reason_category': 'If Body', 'usage_line': 152}, {'reason_category': 'If Condition', 'usage_line':...
Global_Variable 'extractedWords' used at line 150 is defined at line 97 and has a Long-Range dependency. Global_Variable 'ones' used at line 151 is defined at line 94 and has a Long-Range dependency. Variable 'which' used at line 152 is defined at line 150 and has a Short-Range dependency. Variable 'k' used at line 152...
{'If Body': 7, 'Define Stop Criteria': 1, 'Loop Body': 4, 'If Condition': 1}
{'Global_Variable Long-Range': 2, 'Variable Short-Range': 4}
completion_java
CounterTester
160
160
['import junit.framework.TestCase;', 'import java.io.*;', 'import java.util.HashMap;', 'import java.util.TreeMap;', 'import java.util.ArrayList;', '', '/**', ' * This silly little class wraps String, int pairs so they can be sorted.', ' * Used by the WordCounter class.', ' */', 'class WordWrapper implements Comparable ...
[' return extractedWords.get (k).extractWord ();']
[' }', ' }', '}', '/**', ' * A JUnit test case class.', ' * Every method starting with the word "test" will be called when running', ' * the test with JUnit.', ' */', 'public class CounterTester extends TestCase {', '', ' /**', ' * File object to read words from, with buffering.', ' */', ' private FileReader ...
[{'reason_category': 'Else Reasoning', 'usage_line': 160}]
Global_Variable 'extractedWords' used at line 160 is defined at line 97 and has a Long-Range dependency. Variable 'k' used at line 160 is defined at line 146 and has a Medium-Range dependency. Function 'extractWord' used at line 160 is defined at line 30 and has a Long-Range dependency.
{'Else Reasoning': 1}
{'Global_Variable Long-Range': 1, 'Variable Medium-Range': 1, 'Function Long-Range': 1}
completion_java
CounterTester
147
162
['import junit.framework.TestCase;', 'import java.io.*;', 'import java.util.HashMap;', 'import java.util.TreeMap;', 'import java.util.ArrayList;', '', '/**', ' * This silly little class wraps String, int pairs so they can be sorted.', ' * Used by the WordCounter class.', ' */', 'class WordWrapper implements Comparable ...
['', ' // if we got here, then the array is all set up, so just return the kth most frequent word', ' if (k >= extractedWords.size ()) {', ' int which = extractedWords.size ();', ' for (String s : ones.navigableKeySet ()) {', ' if (which == k)', ' return s;', ' which++;', ' }...
['}', '/**', ' * A JUnit test case class.', ' * Every method starting with the word "test" will be called when running', ' * the test with JUnit.', ' */', 'public class CounterTester extends TestCase {', '', ' /**', ' * File object to read words from, with buffering.', ' */', ' private FileReader file = null;...
[{'reason_category': 'If Condition', 'usage_line': 149}, {'reason_category': 'If Body', 'usage_line': 150}, {'reason_category': 'If Body', 'usage_line': 151}, {'reason_category': 'Define Stop Criteria', 'usage_line': 151}, {'reason_category': 'Loop Body', 'usage_line': 152}, {'reason_category': 'If Body', 'usage_line':...
Variable 'k' used at line 149 is defined at line 146 and has a Short-Range dependency. Global_Variable 'extractedWords' used at line 149 is defined at line 97 and has a Long-Range dependency. Global_Variable 'extractedWords' used at line 150 is defined at line 97 and has a Long-Range dependency. Global_Variable 'ones' ...
{'If Condition': 2, 'If Body': 7, 'Define Stop Criteria': 1, 'Loop Body': 4, 'Else Reasoning': 5}
{'Variable Short-Range': 5, 'Global_Variable Long-Range': 4, 'Variable Medium-Range': 1, 'Function Long-Range': 1}
completion_java
CounterTester
201
201
['import junit.framework.TestCase;', 'import java.io.*;', 'import java.util.HashMap;', 'import java.util.TreeMap;', 'import java.util.ArrayList;', '', '/**', ' * This silly little class wraps String, int pairs so they can be sorted.', ' * Used by the WordCounter class.', ' */', 'class WordWrapper implements Comparable ...
[' closeFiles();']
[' }', '', ' /**', ' * Open file and set up readers.', ' *', ' * @param fileName name of file to open', ' * */', ' private void openFile(String fileName) {', ' try {', ' file = new FileReader(fileName);', ' reader = new BufferedReader(file);', ' } catch (Exception e) {', ' System.err....
[]
Function 'closeFiles' used at line 201 is defined at line 180 and has a Medium-Range dependency.
{}
{'Function Medium-Range': 1}
completion_java
CounterTester
237
237
['import junit.framework.TestCase;', 'import java.io.*;', 'import java.util.HashMap;', 'import java.util.TreeMap;', 'import java.util.ArrayList;', '', '/**', ' * This silly little class wraps String, int pairs so they can be sorted.', ' * Used by the WordCounter class.', ' */', 'class WordWrapper implements Comparable ...
[' counter.insert(word);']
[' }', ' } catch (Exception e) {', ' System.err.println("Problem reading file");', ' System.err.println(e);', ' e.printStackTrace();', ' fail();', ' }', ' }', '', ' /**', ' * Read the next numWords from the file, mixing with queries', ' *', ' * @param counter word counter to upd...
[{'reason_category': 'Loop Body', 'usage_line': 237}]
Variable 'counter' used at line 237 is defined at line 227 and has a Short-Range dependency. Variable 'word' used at line 237 is defined at line 232 and has a Short-Range dependency.
{'Loop Body': 1}
{'Variable Short-Range': 2}
completion_java
CounterTester
259
261
['import junit.framework.TestCase;', 'import java.io.*;', 'import java.util.HashMap;', 'import java.util.TreeMap;', 'import java.util.ArrayList;', '', '/**', ' * This silly little class wraps String, int pairs so they can be sorted.', ' * Used by the WordCounter class.', ' */', 'class WordWrapper implements Comparable ...
[' if (word == null) {', ' return;', ' }']
[' counter.insert(word);', '', ' // If the current iteration number is a multiple of 10 and greater than 100,000, perform a query of the kth most frequent word.', ' if (i % 10 == 0 && i > 100000) {', ' String myStr = counter.getKthMostFrequent(j++);', ' }', '', ' // rest j on...
[{'reason_category': 'Loop Body', 'usage_line': 259}, {'reason_category': 'If Condition', 'usage_line': 259}, {'reason_category': 'Loop Body', 'usage_line': 260}, {'reason_category': 'If Body', 'usage_line': 260}, {'reason_category': 'Loop Body', 'usage_line': 261}, {'reason_category': 'If Body', 'usage_line': 261}]
Variable 'word' used at line 259 is defined at line 257 and has a Short-Range dependency.
{'Loop Body': 3, 'If Condition': 1, 'If Body': 2}
{'Variable Short-Range': 1}
completion_java
CounterTester
265
267
['import junit.framework.TestCase;', 'import java.io.*;', 'import java.util.HashMap;', 'import java.util.TreeMap;', 'import java.util.ArrayList;', '', '/**', ' * This silly little class wraps String, int pairs so they can be sorted.', ' * Used by the WordCounter class.', ' */', 'class WordWrapper implements Comparable ...
[' if (i % 10 == 0 && i > 100000) {', ' String myStr = counter.getKthMostFrequent(j++);', ' }']
['', ' // rest j once we get to 100', ' if (j == 100)', ' j = 0;', ' }', ' } catch (Exception e) {', ' System.err.println("Problem reading file");', ' System.err.println(e);', ' e.printStackTrace();', ' fail();', ' }', ' }', '', ' /**', ' * Check that a sequence...
[{'reason_category': 'Loop Body', 'usage_line': 265}, {'reason_category': 'If Condition', 'usage_line': 265}, {'reason_category': 'Loop Body', 'usage_line': 266}, {'reason_category': 'If Body', 'usage_line': 266}, {'reason_category': 'Loop Body', 'usage_line': 267}, {'reason_category': 'If Body', 'usage_line': 267}]
Variable 'i' used at line 265 is defined at line 256 and has a Short-Range dependency. Variable 'counter' used at line 266 is defined at line 253 and has a Medium-Range dependency. Variable 'j' used at line 266 is defined at line 255 and has a Medium-Range dependency.
{'Loop Body': 3, 'If Condition': 1, 'If Body': 2}
{'Variable Short-Range': 1, 'Variable Medium-Range': 2}
completion_java
CounterTester
270
271
['import junit.framework.TestCase;', 'import java.io.*;', 'import java.util.HashMap;', 'import java.util.TreeMap;', 'import java.util.ArrayList;', '', '/**', ' * This silly little class wraps String, int pairs so they can be sorted.', ' * Used by the WordCounter class.', ' */', 'class WordWrapper implements Comparable ...
[' if (j == 100)', ' j = 0;']
[' }', ' } catch (Exception e) {', ' System.err.println("Problem reading file");', ' System.err.println(e);', ' e.printStackTrace();', ' fail();', ' }', ' }', '', ' /**', ' * Check that a sequence of words starts at the "start"th most', ' * frequent word.', ' *', ' * @param coun...
[{'reason_category': 'Loop Body', 'usage_line': 270}, {'reason_category': 'If Condition', 'usage_line': 270}, {'reason_category': 'Loop Body', 'usage_line': 271}, {'reason_category': 'If Body', 'usage_line': 271}]
Variable 'j' used at line 270 is defined at line 255 and has a Medium-Range dependency. Variable 'j' used at line 271 is defined at line 255 and has a Medium-Range dependency.
{'Loop Body': 2, 'If Condition': 1, 'If Body': 1}
{'Variable Medium-Range': 2}
completion_java
CounterTester
291
295
['import junit.framework.TestCase;', 'import java.io.*;', 'import java.util.HashMap;', 'import java.util.TreeMap;', 'import java.util.ArrayList;', '', '/**', ' * This silly little class wraps String, int pairs so they can be sorted.', ' * Used by the WordCounter class.', ' */', 'class WordWrapper implements Comparable ...
[' String actual = counter.getKthMostFrequent(start);', ' System.out.format("k: %d, expected: %s, actual: %s\\n",', ' start, expected[i], actual);', ' assertEquals(expected[i], actual);', ' start++;']
[' }', ' }', '', ' /**', ' * A test method.', ' * (Replace "X" with a name describing the test. You may write as', ' * many "testSomething" methods in this class as you wish, and each', ' * one will be called when running JUnit over this class.)', ' */', ' public void testSimple() {', ' System.out.p...
[{'reason_category': 'Loop Body', 'usage_line': 291}, {'reason_category': 'Loop Body', 'usage_line': 292}, {'reason_category': 'Loop Body', 'usage_line': 293}, {'reason_category': 'Loop Body', 'usage_line': 294}, {'reason_category': 'Loop Body', 'usage_line': 295}]
Variable 'counter' used at line 291 is defined at line 289 and has a Short-Range dependency. Variable 'start' used at line 291 is defined at line 289 and has a Short-Range dependency. Variable 'start' used at line 293 is defined at line 289 and has a Short-Range dependency. Variable 'expected' used at line 293 is defin...
{'Loop Body': 5}
{'Variable Short-Range': 10}
completion_java
CounterTester
310
311
['import junit.framework.TestCase;', 'import java.io.*;', 'import java.util.HashMap;', 'import java.util.TreeMap;', 'import java.util.ArrayList;', '', '/**', ' * This silly little class wraps String, int pairs so they can be sorted.', ' * Used by the WordCounter class.', ' */', 'class WordWrapper implements Comparable ...
[' counter.insert("pizza");', ' counter.insert("pizza");']
[' String [] expected = {"pizza"};', ' checkExpected(counter, 0, expected);', ' }', '', ' public void testTie() {', ' System.out.println("\\nChecking tie for 2nd place");', ' WordCounter counter = new WordCounter();', ' counter.insert("panache");', ' counter.insert("pizzaz");', ' counter.insert("...
[]
Function 'WordCounter.insert' used at line 310 is defined at line 105 and has a Long-Range dependency. Function 'WordCounter.insert' used at line 311 is defined at line 105 and has a Long-Range dependency.
{}
{'Function Long-Range': 2}
completion_java
CounterTester
356
356
['import junit.framework.TestCase;', 'import java.io.*;', 'import java.util.HashMap;', 'import java.util.TreeMap;', 'import java.util.ArrayList;', '', '/**', ' * This silly little class wraps String, int pairs so they can be sorted.', ' * Used by the WordCounter class.', ' */', 'class WordWrapper implements Comparable ...
[' openFile("allWordsBig");']
[' // Read the next 100 words', ' readWords(counter, 100);', ' String [] expected = {"edu", "comp", "cs", "windows", "cmu"};', ' checkExpected(counter, 0, expected);', ' }', '', ' public void test300Top5() {', ' System.out.println("\\nChecking top 5 of first 100 words");', ' WordCounter counter = ne...
[]
Function 'openFile' used at line 356 is defined at line 209 and has a Long-Range dependency.
{}
{'Function Long-Range': 1}
completion_java
CounterTester
358
358
['import junit.framework.TestCase;', 'import java.io.*;', 'import java.util.HashMap;', 'import java.util.TreeMap;', 'import java.util.ArrayList;', '', '/**', ' * This silly little class wraps String, int pairs so they can be sorted.', ' * Used by the WordCounter class.', ' */', 'class WordWrapper implements Comparable ...
[' readWords(counter, 100);']
[' String [] expected = {"edu", "comp", "cs", "windows", "cmu"};', ' checkExpected(counter, 0, expected);', ' }', '', ' public void test300Top5() {', ' System.out.println("\\nChecking top 5 of first 100 words");', ' WordCounter counter = new WordCounter();', ' openFile("allWordsBig");', ' readWords(...
[]
Function 'readWords' used at line 358 is defined at line 227 and has a Long-Range dependency. Variable 'counter' used at line 358 is defined at line 354 and has a Short-Range dependency.
{}
{'Function Long-Range': 1, 'Variable Short-Range': 1}
completion_java
CounterTester
367
367
['import junit.framework.TestCase;', 'import java.io.*;', 'import java.util.HashMap;', 'import java.util.TreeMap;', 'import java.util.ArrayList;', '', '/**', ' * This silly little class wraps String, int pairs so they can be sorted.', ' * Used by the WordCounter class.', ' */', 'class WordWrapper implements Comparable ...
[' readWords(counter, 100);']
[' String [] expected1 = {"edu", "comp", "cs", "windows", "cmu"};', ' checkExpected(counter, 0, expected1);', '', ' System.out.println("Adding 100 more words and rechecking top 5");', ' readWords(counter, 100);', ' String [] expected2 = {"edu", "cmu", "comp", "cs", "state"};', ' checkExpected(counter,...
[]
Function 'readWords' used at line 367 is defined at line 227 and has a Long-Range dependency. Variable 'counter' used at line 367 is defined at line 365 and has a Short-Range dependency.
{}
{'Function Long-Range': 1, 'Variable Short-Range': 1}
completion_java
CounterTester
369
369
['import junit.framework.TestCase;', 'import java.io.*;', 'import java.util.HashMap;', 'import java.util.TreeMap;', 'import java.util.ArrayList;', '', '/**', ' * This silly little class wraps String, int pairs so they can be sorted.', ' * Used by the WordCounter class.', ' */', 'class WordWrapper implements Comparable ...
[' checkExpected(counter, 0, expected1);']
['', ' System.out.println("Adding 100 more words and rechecking top 5");', ' readWords(counter, 100);', ' String [] expected2 = {"edu", "cmu", "comp", "cs", "state"};', ' checkExpected(counter, 0, expected2);', '', ' System.out.println("Adding 100 more words and rechecking top 5");', ' readWords(count...
[]
Function 'checkExpected' used at line 369 is defined at line 289 and has a Long-Range dependency. Variable 'counter' used at line 369 is defined at line 365 and has a Short-Range dependency. Variable 'expected1' used at line 369 is defined at line 368 and has a Short-Range dependency.
{}
{'Function Long-Range': 1, 'Variable Short-Range': 2}
completion_java
CounterTester
374
374
['import junit.framework.TestCase;', 'import java.io.*;', 'import java.util.HashMap;', 'import java.util.TreeMap;', 'import java.util.ArrayList;', '', '/**', ' * This silly little class wraps String, int pairs so they can be sorted.', ' * Used by the WordCounter class.', ' */', 'class WordWrapper implements Comparable ...
[' checkExpected(counter, 0, expected2);']
['', ' System.out.println("Adding 100 more words and rechecking top 5");', ' readWords(counter, 100);', ' String [] expected3 = {"edu", "cmu", "comp", "ohio", "state"};', ' checkExpected(counter, 0, expected3);', ' }', '', ' public void test300Words14Thru19() {', ' System.out.println("\\nChecking rank ...
[]
Function 'checkExpected' used at line 374 is defined at line 289 and has a Long-Range dependency. Variable 'counter' used at line 374 is defined at line 365 and has a Short-Range dependency. Variable 'expected2' used at line 374 is defined at line 373 and has a Short-Range dependency.
{}
{'Function Long-Range': 1, 'Variable Short-Range': 2}
completion_java
CounterTester
387
387
['import junit.framework.TestCase;', 'import java.io.*;', 'import java.util.HashMap;', 'import java.util.TreeMap;', 'import java.util.ArrayList;', '', '/**', ' * This silly little class wraps String, int pairs so they can be sorted.', ' * Used by the WordCounter class.', ' */', 'class WordWrapper implements Comparable ...
[' readWords(counter, 300);']
[' String [] expected = {"cantaloupe", "from", "ksu", "okstate", "on", "srv"};', ' checkExpected(counter, 14, expected);', ' }', '', ' public void test300CorrectNumber() {', ' System.out.println("\\nChecking correct number of unique words in 300 words");', ' WordCounter counter = new WordCounter();', ' ...
[]
Function 'readWords' used at line 387 is defined at line 227 and has a Long-Range dependency. Variable 'counter' used at line 387 is defined at line 384 and has a Short-Range dependency.
{}
{'Function Long-Range': 1, 'Variable Short-Range': 1}
completion_java
CounterTester
389
389
['import junit.framework.TestCase;', 'import java.io.*;', 'import java.util.HashMap;', 'import java.util.TreeMap;', 'import java.util.ArrayList;', '', '/**', ' * This silly little class wraps String, int pairs so they can be sorted.', ' * Used by the WordCounter class.', ' */', 'class WordWrapper implements Comparable ...
[' checkExpected(counter, 14, expected);']
[' }', '', ' public void test300CorrectNumber() {', ' System.out.println("\\nChecking correct number of unique words in 300 words");', ' WordCounter counter = new WordCounter();', ' openFile("allWordsBig");', ' readWords(counter, 300);', ' /* check the 122th, 123th, and 124th most frequent word in the c...
[]
Function 'checkExpected' used at line 389 is defined at line 289 and has a Long-Range dependency. Variable 'counter' used at line 389 is defined at line 384 and has a Short-Range dependency. Variable 'expected' used at line 389 is defined at line 388 and has a Short-Range dependency.
{}
{'Function Long-Range': 1, 'Variable Short-Range': 2}
completion_java
CounterTester
396
396
['import junit.framework.TestCase;', 'import java.io.*;', 'import java.util.HashMap;', 'import java.util.TreeMap;', 'import java.util.ArrayList;', '', '/**', ' * This silly little class wraps String, int pairs so they can be sorted.', ' * Used by the WordCounter class.', ' */', 'class WordWrapper implements Comparable ...
[' readWords(counter, 300);']
[' /* check the 122th, 123th, and 124th most frequent word in the corpus so far ', ' * and check if the result is not null.', ' */', ' assertNotNull(counter.getKthMostFrequent(122));', ' assertNotNull(counter.getKthMostFrequent(123));', ' assertNotNull(counter.getKthMostFrequent(124));', ' // check ...
[]
Function 'readWords' used at line 396 is defined at line 227 and has a Long-Range dependency. Variable 'counter' used at line 396 is defined at line 394 and has a Short-Range dependency.
{}
{'Function Long-Range': 1, 'Variable Short-Range': 1}
completion_java
CounterTester
400
402
['import junit.framework.TestCase;', 'import java.io.*;', 'import java.util.HashMap;', 'import java.util.TreeMap;', 'import java.util.ArrayList;', '', '/**', ' * This silly little class wraps String, int pairs so they can be sorted.', ' * Used by the WordCounter class.', ' */', 'class WordWrapper implements Comparable ...
[' assertNotNull(counter.getKthMostFrequent(122));', ' assertNotNull(counter.getKthMostFrequent(123));', ' assertNotNull(counter.getKthMostFrequent(124));']
[' // check the 125th most frequent word in the corpus so far', ' // and check if the result is null.', ' assertNull(counter.getKthMostFrequent(125));', ' }', '', ' public void test300and100() {', ' System.out.println("\\nChecking top 5 of 100 and 300 words with two counters");', ' WordCounter counter1...
[]
Function 'WordCounter.getKthMostFrequent' used at line 400 is defined at line 146 and has a Long-Range dependency. Function 'WordCounter.getKthMostFrequent' used at line 401 is defined at line 146 and has a Long-Range dependency. Function 'WordCounter.getKthMostFrequent' used at line 402 is defined at line 146 and has ...
{}
{'Function Long-Range': 3}
completion_java
CounterTester
405
405
['import junit.framework.TestCase;', 'import java.io.*;', 'import java.util.HashMap;', 'import java.util.TreeMap;', 'import java.util.ArrayList;', '', '/**', ' * This silly little class wraps String, int pairs so they can be sorted.', ' * Used by the WordCounter class.', ' */', 'class WordWrapper implements Comparable ...
[' assertNull(counter.getKthMostFrequent(125));']
[' }', '', ' public void test300and100() {', ' System.out.println("\\nChecking top 5 of 100 and 300 words with two counters");', ' WordCounter counter1 = new WordCounter();', ' openFile("allWordsBig");', ' readWords(counter1, 300);', ' closeFiles();', '', ' WordCounter counter2 = new WordCounter();'...
[]
Function 'WordCounter.getKthMostFrequent' used at line 405 is defined at line 146 and has a Long-Range dependency.
{}
{'Function Long-Range': 1}
completion_java
CounterTester
410
412
['import junit.framework.TestCase;', 'import java.io.*;', 'import java.util.HashMap;', 'import java.util.TreeMap;', 'import java.util.ArrayList;', '', '/**', ' * This silly little class wraps String, int pairs so they can be sorted.', ' * Used by the WordCounter class.', ' */', 'class WordWrapper implements Comparable ...
[' WordCounter counter1 = new WordCounter();', ' openFile("allWordsBig");', ' readWords(counter1, 300);']
[' closeFiles();', '', ' WordCounter counter2 = new WordCounter();', ' openFile("allWordsBig");', ' readWords(counter2, 100);', '', ' String [] expected1 = {"edu", "cmu", "comp", "ohio", "state"};', ' checkExpected(counter1, 0, expected1);', '', ' String [] expected2 = {"edu", "comp", "cs", "window...
[]
Class 'WordCounter' used at line 410 is defined at line 89 and has a Long-Range dependency. Function 'openFile' used at line 411 is defined at line 209 and has a Long-Range dependency. Function 'readWords' used at line 412 is defined at line 227 and has a Long-Range dependency. Variable 'counter1' used at line 412 is d...
{}
{'Class Long-Range': 1, 'Function Long-Range': 2, 'Variable Short-Range': 1}
completion_java
CounterTester
431
431
['import junit.framework.TestCase;', 'import java.io.*;', 'import java.util.HashMap;', 'import java.util.TreeMap;', 'import java.util.ArrayList;', '', '/**', ' * This silly little class wraps String, int pairs so they can be sorted.', ' * Used by the WordCounter class.', ' */', 'class WordWrapper implements Comparable ...
[' readWords(counter, 6000000);']
[' String [] expected = {"the", "edu", "to", "of", "and",', ' "in", "is", "ax", "that", "it",', ' "cmu", "for", "com", "you", "cs"};', ' checkExpected(counter, 0, expected);', ' }', '', ' public void testAllTop10000() {', ' System.out.println("\\nChecking tim...
[]
Function 'readWords' used at line 431 is defined at line 227 and has a Long-Range dependency. Variable 'counter' used at line 431 is defined at line 428 and has a Short-Range dependency.
{}
{'Function Long-Range': 1, 'Variable Short-Range': 1}
completion_java
CounterTester
445
445
['import junit.framework.TestCase;', 'import java.io.*;', 'import java.util.HashMap;', 'import java.util.TreeMap;', 'import java.util.ArrayList;', '', '/**', ' * This silly little class wraps String, int pairs so they can be sorted.', ' * Used by the WordCounter class.', ' */', 'class WordWrapper implements Comparable ...
[' counter.getKthMostFrequent(i);']
[' }', ' }', '', ' public void testSpeed() {', ' System.out.println("\\nMixing adding data with finding top k");', ' WordCounter counter = new WordCounter();', ' openFile("allWordsBig");', ' readWordsMixed (counter, 6000000);', ' String [] expected = {"the", "edu", "to", "of", "and",', ' ...
[{'reason_category': 'Loop Body', 'usage_line': 445}]
Function 'WordCounter.getKthMostFrequent' used at line 445 is defined at line 146 and has a Long-Range dependency. Variable 'i' used at line 445 is defined at line 444 and has a Short-Range dependency.
{'Loop Body': 1}
{'Function Long-Range': 1, 'Variable Short-Range': 1}
infilling_python
Image_Filtering
10
22
['import numpy as np', 'import cv2', 'import matplotlib.pyplot as plt', 'from scipy.signal import convolve2d', 'from scipy.signal import butter, filtfilt', '', '# Task1', '# Gaussian blurring einstein monroe illusion', 'def gaussian2D(sigma, kernel_size):']
[' sigma_x, sigma_y = sigma', ' size_x, size_y = kernel_size', '', ' size_x = int(size_x) // 2 * 2 + 1', ' size_y = int(size_y) // 2 * 2 + 1', '', ' x, y = np.meshgrid(np.linspace(-3*sigma_x, 3*sigma_x, size_x),', ' np.linspace(-3*sigma_y, 3*sigma_y, size_y))', ' ', ' kernel ...
['', 'def center_crop(image, target_size):', ' image = np.array(image)', ' h, w = image.shape[:2]', '', ' left = (w - target_size[0]) // 2', ' top = (h - target_size[1]) // 2', '', ' right = left + target_size[0]', ' bottom = top + target_size[1]', '', ' cropped_image = image[top:bottom, 0:right]',...
[]
Variable 'sigma' used at line 10 is defined at line 9 and has a Short-Range dependency. Variable 'kernel_size' used at line 11 is defined at line 9 and has a Short-Range dependency. Variable 'size_x' used at line 13 is defined at line 11 and has a Short-Range dependency. Variable 'size_y' used at line 14 is defined at ...
{}
{'Variable Short-Range': 17, 'Library Medium-Range': 4}
infilling_python
Image_Filtering
14
14
['import numpy as np', 'import cv2', 'import matplotlib.pyplot as plt', 'from scipy.signal import convolve2d', 'from scipy.signal import butter, filtfilt', '', '# Task1', '# Gaussian blurring einstein monroe illusion', 'def gaussian2D(sigma, kernel_size):', ' sigma_x, sigma_y = sigma', ' size_x, size_y = kernel_s...
[' size_y = int(size_y) // 2 * 2 + 1']
['', ' x, y = np.meshgrid(np.linspace(-3*sigma_x, 3*sigma_x, size_x),', ' np.linspace(-3*sigma_y, 3*sigma_y, size_y))', ' ', ' kernel = np.exp(-(x**2 / (2*sigma_x**2) + y**2 / (2*sigma_y**2)))', ' kernel /= 2 * np.pi * sigma_x * sigma_y', ' kernel /= kernel.sum()', ' return kern...
[]
Variable 'size_y' used at line 14 is defined at line 11 and has a Short-Range dependency.
{}
{'Variable Short-Range': 1}
infilling_python
Image_Filtering
16
22
['import numpy as np', 'import cv2', 'import matplotlib.pyplot as plt', 'from scipy.signal import convolve2d', 'from scipy.signal import butter, filtfilt', '', '# Task1', '# Gaussian blurring einstein monroe illusion', 'def gaussian2D(sigma, kernel_size):', ' sigma_x, sigma_y = sigma', ' size_x, size_y = kernel_s...
[' x, y = np.meshgrid(np.linspace(-3*sigma_x, 3*sigma_x, size_x),', ' np.linspace(-3*sigma_y, 3*sigma_y, size_y))', ' ', ' kernel = np.exp(-(x**2 / (2*sigma_x**2) + y**2 / (2*sigma_y**2)))', ' kernel /= 2 * np.pi * sigma_x * sigma_y', ' kernel /= kernel.sum()', ' return kernel']
['', 'def center_crop(image, target_size):', ' image = np.array(image)', ' h, w = image.shape[:2]', '', ' left = (w - target_size[0]) // 2', ' top = (h - target_size[1]) // 2', '', ' right = left + target_size[0]', ' bottom = top + target_size[1]', '', ' cropped_image = image[top:bottom, 0:right]',...
[]
Library 'np' used at line 16 is imported at line 1 and has a Medium-Range dependency. Variable 'sigma_x' used at line 16 is defined at line 10 and has a Short-Range dependency. Variable 'size_x' used at line 16 is defined at line 13 and has a Short-Range dependency. Library 'np' used at line 17 is imported at line 1 an...
{}
{'Library Medium-Range': 4, 'Variable Short-Range': 13}
infilling_python
Image_Filtering
16
17
['import numpy as np', 'import cv2', 'import matplotlib.pyplot as plt', 'from scipy.signal import convolve2d', 'from scipy.signal import butter, filtfilt', '', '# Task1', '# Gaussian blurring einstein monroe illusion', 'def gaussian2D(sigma, kernel_size):', ' sigma_x, sigma_y = sigma', ' size_x, size_y = kernel_s...
[' x, y = np.meshgrid(np.linspace(-3*sigma_x, 3*sigma_x, size_x),', ' np.linspace(-3*sigma_y, 3*sigma_y, size_y))']
[' ', ' kernel = np.exp(-(x**2 / (2*sigma_x**2) + y**2 / (2*sigma_y**2)))', ' kernel /= 2 * np.pi * sigma_x * sigma_y', ' kernel /= kernel.sum()', ' return kernel', '', 'def center_crop(image, target_size):', ' image = np.array(image)', ' h, w = image.shape[:2]', '', ' left = (w - target_size[0]...
[]
Library 'np' used at line 16 is imported at line 1 and has a Medium-Range dependency. Variable 'sigma_x' used at line 16 is defined at line 10 and has a Short-Range dependency. Variable 'size_x' used at line 16 is defined at line 13 and has a Short-Range dependency. Library 'np' used at line 17 is imported at line 1 an...
{}
{'Library Medium-Range': 2, 'Variable Short-Range': 4}
infilling_python
Image_Filtering
17
17
['import numpy as np', 'import cv2', 'import matplotlib.pyplot as plt', 'from scipy.signal import convolve2d', 'from scipy.signal import butter, filtfilt', '', '# Task1', '# Gaussian blurring einstein monroe illusion', 'def gaussian2D(sigma, kernel_size):', ' sigma_x, sigma_y = sigma', ' size_x, size_y = kernel_s...
[' np.linspace(-3*sigma_y, 3*sigma_y, size_y))']
[' ', ' kernel = np.exp(-(x**2 / (2*sigma_x**2) + y**2 / (2*sigma_y**2)))', ' kernel /= 2 * np.pi * sigma_x * sigma_y', ' kernel /= kernel.sum()', ' return kernel', '', 'def center_crop(image, target_size):', ' image = np.array(image)', ' h, w = image.shape[:2]', '', ' left = (w - target_size[0]...
[]
Library 'np' used at line 17 is imported at line 1 and has a Medium-Range dependency. Variable 'sigma_y' used at line 17 is defined at line 10 and has a Short-Range dependency. Variable 'size_y' used at line 17 is defined at line 14 and has a Short-Range dependency.
{}
{'Library Medium-Range': 1, 'Variable Short-Range': 2}
infilling_python
Image_Filtering
19
22
['import numpy as np', 'import cv2', 'import matplotlib.pyplot as plt', 'from scipy.signal import convolve2d', 'from scipy.signal import butter, filtfilt', '', '# Task1', '# Gaussian blurring einstein monroe illusion', 'def gaussian2D(sigma, kernel_size):', ' sigma_x, sigma_y = sigma', ' size_x, size_y = kernel_s...
[' kernel = np.exp(-(x**2 / (2*sigma_x**2) + y**2 / (2*sigma_y**2)))', ' kernel /= 2 * np.pi * sigma_x * sigma_y', ' kernel /= kernel.sum()', ' return kernel']
['', 'def center_crop(image, target_size):', ' image = np.array(image)', ' h, w = image.shape[:2]', '', ' left = (w - target_size[0]) // 2', ' top = (h - target_size[1]) // 2', '', ' right = left + target_size[0]', ' bottom = top + target_size[1]', '', ' cropped_image = image[top:bottom, 0:right]',...
[]
Library 'np' used at line 19 is imported at line 1 and has a Medium-Range dependency. Variable 'x' used at line 19 is defined at line 16 and has a Short-Range dependency. Variable 'sigma_x' used at line 19 is defined at line 10 and has a Short-Range dependency. Variable 'y' used at line 19 is defined at line 16 and has...
{}
{'Library Medium-Range': 2, 'Variable Short-Range': 9}
infilling_python
Image_Filtering
19
19
['import numpy as np', 'import cv2', 'import matplotlib.pyplot as plt', 'from scipy.signal import convolve2d', 'from scipy.signal import butter, filtfilt', '', '# Task1', '# Gaussian blurring einstein monroe illusion', 'def gaussian2D(sigma, kernel_size):', ' sigma_x, sigma_y = sigma', ' size_x, size_y = kernel_s...
[' kernel = np.exp(-(x**2 / (2*sigma_x**2) + y**2 / (2*sigma_y**2)))']
[' kernel /= 2 * np.pi * sigma_x * sigma_y', ' kernel /= kernel.sum()', ' return kernel', '', 'def center_crop(image, target_size):', ' image = np.array(image)', ' h, w = image.shape[:2]', '', ' left = (w - target_size[0]) // 2', ' top = (h - target_size[1]) // 2', '', ' right = left + target_si...
[]
Library 'np' used at line 19 is imported at line 1 and has a Medium-Range dependency. Variable 'x' used at line 19 is defined at line 16 and has a Short-Range dependency. Variable 'sigma_x' used at line 19 is defined at line 10 and has a Short-Range dependency. Variable 'y' used at line 19 is defined at line 16 and has...
{}
{'Library Medium-Range': 1, 'Variable Short-Range': 4}
infilling_python
Image_Filtering
20
22
['import numpy as np', 'import cv2', 'import matplotlib.pyplot as plt', 'from scipy.signal import convolve2d', 'from scipy.signal import butter, filtfilt', '', '# Task1', '# Gaussian blurring einstein monroe illusion', 'def gaussian2D(sigma, kernel_size):', ' sigma_x, sigma_y = sigma', ' size_x, size_y = kernel_s...
[' kernel /= 2 * np.pi * sigma_x * sigma_y', ' kernel /= kernel.sum()', ' return kernel']
['', 'def center_crop(image, target_size):', ' image = np.array(image)', ' h, w = image.shape[:2]', '', ' left = (w - target_size[0]) // 2', ' top = (h - target_size[1]) // 2', '', ' right = left + target_size[0]', ' bottom = top + target_size[1]', '', ' cropped_image = image[top:bottom, 0:right]',...
[]
Variable 'kernel' used at line 20 is defined at line 19 and has a Short-Range dependency. Library 'np' used at line 20 is imported at line 1 and has a Medium-Range dependency. Variable 'sigma_x' used at line 20 is defined at line 10 and has a Short-Range dependency. Variable 'sigma_y' used at line 20 is defined at line...
{}
{'Variable Short-Range': 5, 'Library Medium-Range': 1}
infilling_python
Image_Filtering
21
22
['import numpy as np', 'import cv2', 'import matplotlib.pyplot as plt', 'from scipy.signal import convolve2d', 'from scipy.signal import butter, filtfilt', '', '# Task1', '# Gaussian blurring einstein monroe illusion', 'def gaussian2D(sigma, kernel_size):', ' sigma_x, sigma_y = sigma', ' size_x, size_y = kernel_s...
[' kernel /= kernel.sum()', ' return kernel']
['', 'def center_crop(image, target_size):', ' image = np.array(image)', ' h, w = image.shape[:2]', '', ' left = (w - target_size[0]) // 2', ' top = (h - target_size[1]) // 2', '', ' right = left + target_size[0]', ' bottom = top + target_size[1]', '', ' cropped_image = image[top:bottom, 0:right]',...
[]
Variable 'kernel' used at line 21 is defined at line 20 and has a Short-Range dependency. Variable 'kernel' used at line 22 is defined at line 21 and has a Short-Range dependency.
{}
{'Variable Short-Range': 2}
infilling_python
Image_Filtering
26
35
['import numpy as np', 'import cv2', 'import matplotlib.pyplot as plt', 'from scipy.signal import convolve2d', 'from scipy.signal import butter, filtfilt', '', '# Task1', '# Gaussian blurring einstein monroe illusion', 'def gaussian2D(sigma, kernel_size):', ' sigma_x, sigma_y = sigma', ' size_x, size_y = kernel_s...
[' h, w = image.shape[:2]', '', ' left = (w - target_size[0]) // 2', ' top = (h - target_size[1]) // 2', '', ' right = left + target_size[0]', ' bottom = top + target_size[1]', '', ' cropped_image = image[top:bottom, 0:right]', ' return cropped_image']
['', "img_a = cv2.imread('./marilyn.jpeg')", "img_b = cv2.imread('./einstein.jpeg')", '', '# Part1', '# Reshape to ensure images are same size by center cropping to image with smallest dimension', '# Convert img to grayscale ', 'smallest_dim = min(img_a.shape[0],img_a.shape[1],img_b.shape[1],img_b.shape[1])', 'img_a_gr...
[]
Variable 'image' used at line 26 is defined at line 25 and has a Short-Range dependency. Variable 'w' used at line 28 is defined at line 26 and has a Short-Range dependency. Variable 'target_size' used at line 28 is defined at line 24 and has a Short-Range dependency. Variable 'h' used at line 29 is defined at line 26 ...
{}
{'Variable Short-Range': 14}
infilling_python
Image_Filtering
28
29
['import numpy as np', 'import cv2', 'import matplotlib.pyplot as plt', 'from scipy.signal import convolve2d', 'from scipy.signal import butter, filtfilt', '', '# Task1', '# Gaussian blurring einstein monroe illusion', 'def gaussian2D(sigma, kernel_size):', ' sigma_x, sigma_y = sigma', ' size_x, size_y = kernel_s...
[' left = (w - target_size[0]) // 2', ' top = (h - target_size[1]) // 2']
['', ' right = left + target_size[0]', ' bottom = top + target_size[1]', '', ' cropped_image = image[top:bottom, 0:right]', ' return cropped_image', '', "img_a = cv2.imread('./marilyn.jpeg')", "img_b = cv2.imread('./einstein.jpeg')", '', '# Part1', '# Reshape to ensure images are same size by center croppin...
[]
Variable 'w' used at line 28 is defined at line 26 and has a Short-Range dependency. Variable 'target_size' used at line 28 is defined at line 24 and has a Short-Range dependency. Variable 'h' used at line 29 is defined at line 26 and has a Short-Range dependency. Variable 'target_size' used at line 29 is defined at li...
{}
{'Variable Short-Range': 4}
infilling_python
Image_Filtering
29
29
['import numpy as np', 'import cv2', 'import matplotlib.pyplot as plt', 'from scipy.signal import convolve2d', 'from scipy.signal import butter, filtfilt', '', '# Task1', '# Gaussian blurring einstein monroe illusion', 'def gaussian2D(sigma, kernel_size):', ' sigma_x, sigma_y = sigma', ' size_x, size_y = kernel_s...
[' top = (h - target_size[1]) // 2']
['', ' right = left + target_size[0]', ' bottom = top + target_size[1]', '', ' cropped_image = image[top:bottom, 0:right]', ' return cropped_image', '', "img_a = cv2.imread('./marilyn.jpeg')", "img_b = cv2.imread('./einstein.jpeg')", '', '# Part1', '# Reshape to ensure images are same size by center croppin...
[]
Variable 'h' used at line 29 is defined at line 26 and has a Short-Range dependency. Variable 'target_size' used at line 29 is defined at line 24 and has a Short-Range dependency.
{}
{'Variable Short-Range': 2}
infilling_python
Image_Filtering
31
32
['import numpy as np', 'import cv2', 'import matplotlib.pyplot as plt', 'from scipy.signal import convolve2d', 'from scipy.signal import butter, filtfilt', '', '# Task1', '# Gaussian blurring einstein monroe illusion', 'def gaussian2D(sigma, kernel_size):', ' sigma_x, sigma_y = sigma', ' size_x, size_y = kernel_s...
[' right = left + target_size[0]', ' bottom = top + target_size[1]']
['', ' cropped_image = image[top:bottom, 0:right]', ' return cropped_image', '', "img_a = cv2.imread('./marilyn.jpeg')", "img_b = cv2.imread('./einstein.jpeg')", '', '# Part1', '# Reshape to ensure images are same size by center cropping to image with smallest dimension', '# Convert img to grayscale ', 'smallest_...
[]
Variable 'left' used at line 31 is defined at line 28 and has a Short-Range dependency. Variable 'target_size' used at line 31 is defined at line 24 and has a Short-Range dependency. Variable 'top' used at line 32 is defined at line 29 and has a Short-Range dependency. Variable 'target_size' used at line 32 is defined ...
{}
{'Variable Short-Range': 4}
infilling_python
Image_Filtering
32
32
['import numpy as np', 'import cv2', 'import matplotlib.pyplot as plt', 'from scipy.signal import convolve2d', 'from scipy.signal import butter, filtfilt', '', '# Task1', '# Gaussian blurring einstein monroe illusion', 'def gaussian2D(sigma, kernel_size):', ' sigma_x, sigma_y = sigma', ' size_x, size_y = kernel_s...
[' bottom = top + target_size[1]']
['', ' cropped_image = image[top:bottom, 0:right]', ' return cropped_image', '', "img_a = cv2.imread('./marilyn.jpeg')", "img_b = cv2.imread('./einstein.jpeg')", '', '# Part1', '# Reshape to ensure images are same size by center cropping to image with smallest dimension', '# Convert img to grayscale ', 'smallest_...
[]
Variable 'top' used at line 32 is defined at line 29 and has a Short-Range dependency. Variable 'target_size' used at line 32 is defined at line 24 and has a Short-Range dependency.
{}
{'Variable Short-Range': 2}
infilling_python
Image_Filtering
34
35
['import numpy as np', 'import cv2', 'import matplotlib.pyplot as plt', 'from scipy.signal import convolve2d', 'from scipy.signal import butter, filtfilt', '', '# Task1', '# Gaussian blurring einstein monroe illusion', 'def gaussian2D(sigma, kernel_size):', ' sigma_x, sigma_y = sigma', ' size_x, size_y = kernel_s...
[' cropped_image = image[top:bottom, 0:right]', ' return cropped_image']
['', "img_a = cv2.imread('./marilyn.jpeg')", "img_b = cv2.imread('./einstein.jpeg')", '', '# Part1', '# Reshape to ensure images are same size by center cropping to image with smallest dimension', '# Convert img to grayscale ', 'smallest_dim = min(img_a.shape[0],img_a.shape[1],img_b.shape[1],img_b.shape[1])', 'img_a_gr...
[]
Variable 'image' used at line 34 is defined at line 25 and has a Short-Range dependency. Variable 'top' used at line 34 is defined at line 29 and has a Short-Range dependency. Variable 'bottom' used at line 34 is defined at line 32 and has a Short-Range dependency. Variable 'right' used at line 34 is defined at line 31...
{}
{'Variable Short-Range': 5}
infilling_python
Image_Filtering
44
45
['import numpy as np', 'import cv2', 'import matplotlib.pyplot as plt', 'from scipy.signal import convolve2d', 'from scipy.signal import butter, filtfilt', '', '# Task1', '# Gaussian blurring einstein monroe illusion', 'def gaussian2D(sigma, kernel_size):', ' sigma_x, sigma_y = sigma', ' size_x, size_y = kernel_s...
['img_a_gray = center_crop(cv2.cvtColor(img_a, cv2.COLOR_BGR2GRAY),(smallest_dim, smallest_dim))', 'img_b_gray = center_crop(cv2.cvtColor(img_b, cv2.COLOR_BGR2GRAY),(smallest_dim, smallest_dim))']
['print(np.array(img_a_gray))', 'print(np.array(img_b_gray))', '', '# Part2', '# Apply Gaussian filter to both images choose relevant sigma and kernel size to achieve desired results', '# Use custom gaussian2D function and use cv2.filter2D to apply the filter to the image', 'sigma_a = (1, 1)', 'kernel_size_a = (11, 11)...
[]
Function 'center_crop' used at line 44 is defined at line 24 and has a Medium-Range dependency. Library 'cv2' used at line 44 is imported at line 2 and has a Long-Range dependency. Variable 'img_a' used at line 44 is defined at line 37 and has a Short-Range dependency. Variable 'smallest_dim' used at line 44 is defined...
{}
{'Function Medium-Range': 2, 'Library Long-Range': 2, 'Variable Short-Range': 4}
infilling_python
Image_Filtering
45
45
['import numpy as np', 'import cv2', 'import matplotlib.pyplot as plt', 'from scipy.signal import convolve2d', 'from scipy.signal import butter, filtfilt', '', '# Task1', '# Gaussian blurring einstein monroe illusion', 'def gaussian2D(sigma, kernel_size):', ' sigma_x, sigma_y = sigma', ' size_x, size_y = kernel_s...
['img_b_gray = center_crop(cv2.cvtColor(img_b, cv2.COLOR_BGR2GRAY),(smallest_dim, smallest_dim))']
['print(np.array(img_a_gray))', 'print(np.array(img_b_gray))', '', '# Part2', '# Apply Gaussian filter to both images choose relevant sigma and kernel size to achieve desired results', '# Use custom gaussian2D function and use cv2.filter2D to apply the filter to the image', 'sigma_a = (1, 1)', 'kernel_size_a = (11, 11)...
[]
Function 'center_crop' used at line 45 is defined at line 24 and has a Medium-Range dependency. Library 'cv2' used at line 45 is imported at line 2 and has a Long-Range dependency. Variable 'img_b' used at line 45 is defined at line 38 and has a Short-Range dependency. Variable 'smallest_dim' used at line 45 is defined...
{}
{'Function Medium-Range': 1, 'Library Long-Range': 1, 'Variable Short-Range': 2}
infilling_python
Image_Filtering
54
54
['import numpy as np', 'import cv2', 'import matplotlib.pyplot as plt', 'from scipy.signal import convolve2d', 'from scipy.signal import butter, filtfilt', '', '# Task1', '# Gaussian blurring einstein monroe illusion', 'def gaussian2D(sigma, kernel_size):', ' sigma_x, sigma_y = sigma', ' size_x, size_y = kernel_s...
['gaussian_kernel_a = gaussian2D(sigma_a, kernel_size_a)']
['', 'sigma_b = (1, 1)', 'kernel_size_b = (11, 11)', 'gaussian_kernel_b = gaussian2D(sigma_b, kernel_size_b)', '', 'blur_a = cv2.filter2D(img_a_gray, -1, gaussian_kernel_a)', 'blur_b = cv2.filter2D(img_b_gray, -1, gaussian_kernel_b)', '', 'a_diff = img_a_gray - blur_a', 'img_c = blur_b + a_diff', 'print(img_c)', '', 'd...
[]
Function 'gaussian2D' used at line 54 is defined at line 9 and has a Long-Range dependency. Variable 'sigma_a' used at line 54 is defined at line 52 and has a Short-Range dependency. Variable 'kernel_size_a' used at line 54 is defined at line 53 and has a Short-Range dependency.
{}
{'Function Long-Range': 1, 'Variable Short-Range': 2}
infilling_python
Image_Filtering
56
58
['import numpy as np', 'import cv2', 'import matplotlib.pyplot as plt', 'from scipy.signal import convolve2d', 'from scipy.signal import butter, filtfilt', '', '# Task1', '# Gaussian blurring einstein monroe illusion', 'def gaussian2D(sigma, kernel_size):', ' sigma_x, sigma_y = sigma', ' size_x, size_y = kernel_s...
['sigma_b = (1, 1)', 'kernel_size_b = (11, 11)', 'gaussian_kernel_b = gaussian2D(sigma_b, kernel_size_b)']
['', 'blur_a = cv2.filter2D(img_a_gray, -1, gaussian_kernel_a)', 'blur_b = cv2.filter2D(img_b_gray, -1, gaussian_kernel_b)', '', 'a_diff = img_a_gray - blur_a', 'img_c = blur_b + a_diff', 'print(img_c)', '', 'def downsample_image(image, factor):', ' if factor <= 0:', ' raise ValueError("Downsampling factor mu...
[]
Function 'gaussian2D' used at line 58 is defined at line 9 and has a Long-Range dependency. Variable 'sigma_b' used at line 58 is defined at line 56 and has a Short-Range dependency. Variable 'kernel_size_b' used at line 58 is defined at line 57 and has a Short-Range dependency.
{}
{'Function Long-Range': 1, 'Variable Short-Range': 2}
infilling_python
Image_Filtering
58
58
['import numpy as np', 'import cv2', 'import matplotlib.pyplot as plt', 'from scipy.signal import convolve2d', 'from scipy.signal import butter, filtfilt', '', '# Task1', '# Gaussian blurring einstein monroe illusion', 'def gaussian2D(sigma, kernel_size):', ' sigma_x, sigma_y = sigma', ' size_x, size_y = kernel_s...
['gaussian_kernel_b = gaussian2D(sigma_b, kernel_size_b)']
['', 'blur_a = cv2.filter2D(img_a_gray, -1, gaussian_kernel_a)', 'blur_b = cv2.filter2D(img_b_gray, -1, gaussian_kernel_b)', '', 'a_diff = img_a_gray - blur_a', 'img_c = blur_b + a_diff', 'print(img_c)', '', 'def downsample_image(image, factor):', ' if factor <= 0:', ' raise ValueError("Downsampling factor mu...
[]
Function 'gaussian2D' used at line 58 is defined at line 9 and has a Long-Range dependency. Variable 'sigma_b' used at line 58 is defined at line 56 and has a Short-Range dependency. Variable 'kernel_size_b' used at line 58 is defined at line 57 and has a Short-Range dependency.
{}
{'Function Long-Range': 1, 'Variable Short-Range': 2}
infilling_python
Image_Filtering
60
61
['import numpy as np', 'import cv2', 'import matplotlib.pyplot as plt', 'from scipy.signal import convolve2d', 'from scipy.signal import butter, filtfilt', '', '# Task1', '# Gaussian blurring einstein monroe illusion', 'def gaussian2D(sigma, kernel_size):', ' sigma_x, sigma_y = sigma', ' size_x, size_y = kernel_s...
['blur_a = cv2.filter2D(img_a_gray, -1, gaussian_kernel_a)', 'blur_b = cv2.filter2D(img_b_gray, -1, gaussian_kernel_b)']
['', 'a_diff = img_a_gray - blur_a', 'img_c = blur_b + a_diff', 'print(img_c)', '', 'def downsample_image(image, factor):', ' if factor <= 0:', ' raise ValueError("Downsampling factor must be greater than 0.")', ' ', ' height, width = image.shape[:2]', ' new_height = height // factor', ' new_width...
[]
Library 'cv2' used at line 60 is imported at line 2 and has a Long-Range dependency. Variable 'img_a_gray' used at line 60 is defined at line 44 and has a Medium-Range dependency. Variable 'gaussian_kernel_a' used at line 60 is defined at line 54 and has a Short-Range dependency. Library 'cv2' used at line 61 is import...
{}
{'Library Long-Range': 2, 'Variable Medium-Range': 2, 'Variable Short-Range': 2}
infilling_python
Image_Filtering
61
61
['import numpy as np', 'import cv2', 'import matplotlib.pyplot as plt', 'from scipy.signal import convolve2d', 'from scipy.signal import butter, filtfilt', '', '# Task1', '# Gaussian blurring einstein monroe illusion', 'def gaussian2D(sigma, kernel_size):', ' sigma_x, sigma_y = sigma', ' size_x, size_y = kernel_s...
['blur_b = cv2.filter2D(img_b_gray, -1, gaussian_kernel_b)']
['', 'a_diff = img_a_gray - blur_a', 'img_c = blur_b + a_diff', 'print(img_c)', '', 'def downsample_image(image, factor):', ' if factor <= 0:', ' raise ValueError("Downsampling factor must be greater than 0.")', ' ', ' height, width = image.shape[:2]', ' new_height = height // factor', ' new_width...
[]
Library 'cv2' used at line 61 is imported at line 2 and has a Long-Range dependency. Variable 'img_b_gray' used at line 61 is defined at line 45 and has a Medium-Range dependency. Variable 'gaussian_kernel_b' used at line 61 is defined at line 58 and has a Short-Range dependency.
{}
{'Library Long-Range': 1, 'Variable Medium-Range': 1, 'Variable Short-Range': 1}
infilling_python
Image_Filtering
63
64
['import numpy as np', 'import cv2', 'import matplotlib.pyplot as plt', 'from scipy.signal import convolve2d', 'from scipy.signal import butter, filtfilt', '', '# Task1', '# Gaussian blurring einstein monroe illusion', 'def gaussian2D(sigma, kernel_size):', ' sigma_x, sigma_y = sigma', ' size_x, size_y = kernel_s...
['a_diff = img_a_gray - blur_a', 'img_c = blur_b + a_diff']
['print(img_c)', '', 'def downsample_image(image, factor):', ' if factor <= 0:', ' raise ValueError("Downsampling factor must be greater than 0.")', ' ', ' height, width = image.shape[:2]', ' new_height = height // factor', ' new_width = width // factor', '', ' if len(image.shape) == 3:', ' ...
[]
Variable 'img_a_gray' used at line 63 is defined at line 44 and has a Medium-Range dependency. Variable 'blur_a' used at line 63 is defined at line 60 and has a Short-Range dependency. Variable 'blur_b' used at line 64 is defined at line 61 and has a Short-Range dependency. Variable 'a_diff' used at line 64 is defined ...
{}
{'Variable Medium-Range': 1, 'Variable Short-Range': 3}
infilling_python
Image_Filtering
73
73
['import numpy as np', 'import cv2', 'import matplotlib.pyplot as plt', 'from scipy.signal import convolve2d', 'from scipy.signal import butter, filtfilt', '', '# Task1', '# Gaussian blurring einstein monroe illusion', 'def gaussian2D(sigma, kernel_size):', ' sigma_x, sigma_y = sigma', ' size_x, size_y = kernel_s...
[' new_width = width // factor']
['', ' if len(image.shape) == 3:', ' downsampled_image = np.zeros((new_height, new_width, image.shape[2]), dtype=np.uint8)', ' else:', ' downsampled_image = np.zeros((new_height, new_width), dtype=np.uint8)', '', ' for i in range(new_height):', ' for j in range(new_width):', ' d...
[]
Variable 'width' used at line 73 is defined at line 71 and has a Short-Range dependency. Variable 'factor' used at line 73 is defined at line 67 and has a Short-Range dependency.
{}
{'Variable Short-Range': 2}
infilling_python
Image_Filtering
76
76
['import numpy as np', 'import cv2', 'import matplotlib.pyplot as plt', 'from scipy.signal import convolve2d', 'from scipy.signal import butter, filtfilt', '', '# Task1', '# Gaussian blurring einstein monroe illusion', 'def gaussian2D(sigma, kernel_size):', ' sigma_x, sigma_y = sigma', ' size_x, size_y = kernel_s...
[' downsampled_image = np.zeros((new_height, new_width, image.shape[2]), dtype=np.uint8)']
[' else:', ' downsampled_image = np.zeros((new_height, new_width), dtype=np.uint8)', '', ' for i in range(new_height):', ' for j in range(new_width):', ' downsampled_image[i, j] = image[i * factor, j * factor]', ' return downsampled_image', '', 'downsampling_factor = 4', 'downsampled_i...
[{'reason_category': 'If Body', 'usage_line': 76}]
Library 'np' used at line 76 is imported at line 1 and has a Long-Range dependency. Variable 'new_height' used at line 76 is defined at line 72 and has a Short-Range dependency. Variable 'new_width' used at line 76 is defined at line 73 and has a Short-Range dependency. Variable 'image' used at line 76 is defined at li...
{'If Body': 1}
{'Library Long-Range': 1, 'Variable Short-Range': 3}
infilling_python
Image_Filtering
78
78
['import numpy as np', 'import cv2', 'import matplotlib.pyplot as plt', 'from scipy.signal import convolve2d', 'from scipy.signal import butter, filtfilt', '', '# Task1', '# Gaussian blurring einstein monroe illusion', 'def gaussian2D(sigma, kernel_size):', ' sigma_x, sigma_y = sigma', ' size_x, size_y = kernel_s...
[' downsampled_image = np.zeros((new_height, new_width), dtype=np.uint8)']
['', ' for i in range(new_height):', ' for j in range(new_width):', ' downsampled_image[i, j] = image[i * factor, j * factor]', ' return downsampled_image', '', 'downsampling_factor = 4', 'downsampled_image = downsample_image(img_c, downsampling_factor)', 'print(np.array(downsampled_image))', ''...
[{'reason_category': 'Else Reasoning', 'usage_line': 78}]
Library 'np' used at line 78 is imported at line 1 and has a Long-Range dependency. Variable 'new_height' used at line 78 is defined at line 72 and has a Short-Range dependency. Variable 'new_width' used at line 78 is defined at line 73 and has a Short-Range dependency.
{'Else Reasoning': 1}
{'Library Long-Range': 1, 'Variable Short-Range': 2}
infilling_python
Image_Filtering
80
83
['import numpy as np', 'import cv2', 'import matplotlib.pyplot as plt', 'from scipy.signal import convolve2d', 'from scipy.signal import butter, filtfilt', '', '# Task1', '# Gaussian blurring einstein monroe illusion', 'def gaussian2D(sigma, kernel_size):', ' sigma_x, sigma_y = sigma', ' size_x, size_y = kernel_s...
[' for i in range(new_height):', ' for j in range(new_width):', ' downsampled_image[i, j] = image[i * factor, j * factor]', ' return downsampled_image']
['', 'downsampling_factor = 4', 'downsampled_image = downsample_image(img_c, downsampling_factor)', 'print(np.array(downsampled_image))', '', '# Part3', '# Computer fourier magnitude for the final image, original grayscale images, ', '# the blurred second image and difference between grayscale first image and blurred f...
[{'reason_category': 'Define Stop Criteria', 'usage_line': 80}, {'reason_category': 'Define Stop Criteria', 'usage_line': 81}, {'reason_category': 'Loop Body', 'usage_line': 82}]
Variable 'new_height' used at line 80 is defined at line 72 and has a Short-Range dependency. Variable 'new_width' used at line 81 is defined at line 73 and has a Short-Range dependency. Variable 'downsampled_image' used at line 82 is defined at line 78 and has a Short-Range dependency. Variable 'i' used at line 82 is ...
{'Define Stop Criteria': 2, 'Loop Body': 1}
{'Variable Short-Range': 4, 'Variable Loop Short-Range': 2, 'Variable Medium-Range': 2}
infilling_python
Image_Filtering
81
83
['import numpy as np', 'import cv2', 'import matplotlib.pyplot as plt', 'from scipy.signal import convolve2d', 'from scipy.signal import butter, filtfilt', '', '# Task1', '# Gaussian blurring einstein monroe illusion', 'def gaussian2D(sigma, kernel_size):', ' sigma_x, sigma_y = sigma', ' size_x, size_y = kernel_s...
[' for j in range(new_width):', ' downsampled_image[i, j] = image[i * factor, j * factor]', ' return downsampled_image']
['', 'downsampling_factor = 4', 'downsampled_image = downsample_image(img_c, downsampling_factor)', 'print(np.array(downsampled_image))', '', '# Part3', '# Computer fourier magnitude for the final image, original grayscale images, ', '# the blurred second image and difference between grayscale first image and blurred f...
[{'reason_category': 'Define Stop Criteria', 'usage_line': 81}, {'reason_category': 'Loop Body', 'usage_line': 82}]
Variable 'new_width' used at line 81 is defined at line 73 and has a Short-Range dependency. Variable 'downsampled_image' used at line 82 is defined at line 78 and has a Short-Range dependency. Variable 'i' used at line 82 is part of a Loop defined at line 80 and has a Short-Range dependency. Variable 'j' used at line ...
{'Define Stop Criteria': 1, 'Loop Body': 1}
{'Variable Short-Range': 3, 'Variable Loop Short-Range': 2, 'Variable Medium-Range': 2}
infilling_python
Image_Filtering
82
83
['import numpy as np', 'import cv2', 'import matplotlib.pyplot as plt', 'from scipy.signal import convolve2d', 'from scipy.signal import butter, filtfilt', '', '# Task1', '# Gaussian blurring einstein monroe illusion', 'def gaussian2D(sigma, kernel_size):', ' sigma_x, sigma_y = sigma', ' size_x, size_y = kernel_s...
[' downsampled_image[i, j] = image[i * factor, j * factor]', ' return downsampled_image']
['', 'downsampling_factor = 4', 'downsampled_image = downsample_image(img_c, downsampling_factor)', 'print(np.array(downsampled_image))', '', '# Part3', '# Computer fourier magnitude for the final image, original grayscale images, ', '# the blurred second image and difference between grayscale first image and blurred f...
[{'reason_category': 'Loop Body', 'usage_line': 82}]
Variable 'downsampled_image' used at line 82 is defined at line 78 and has a Short-Range dependency. Variable 'i' used at line 82 is part of a Loop defined at line 80 and has a Short-Range dependency. Variable 'j' used at line 82 is part of a Loop defined at line 81 and has a Short-Range dependency. Variable 'image' us...
{'Loop Body': 1}
{'Variable Short-Range': 2, 'Variable Loop Short-Range': 2, 'Variable Medium-Range': 2}
infilling_python
Image_Filtering
72
83
['import numpy as np', 'import cv2', 'import matplotlib.pyplot as plt', 'from scipy.signal import convolve2d', 'from scipy.signal import butter, filtfilt', '', '# Task1', '# Gaussian blurring einstein monroe illusion', 'def gaussian2D(sigma, kernel_size):', ' sigma_x, sigma_y = sigma', ' size_x, size_y = kernel_s...
[' new_height = height // factor', ' new_width = width // factor', '', ' if len(image.shape) == 3:', ' downsampled_image = np.zeros((new_height, new_width, image.shape[2]), dtype=np.uint8)', ' else:', ' downsampled_image = np.zeros((new_height, new_width), dtype=np.uint8)', '', ' for i in r...
['', 'downsampling_factor = 4', 'downsampled_image = downsample_image(img_c, downsampling_factor)', 'print(np.array(downsampled_image))', '', '# Part3', '# Computer fourier magnitude for the final image, original grayscale images, ', '# the blurred second image and difference between grayscale first image and blurred f...
[{'reason_category': 'If Condition', 'usage_line': 75}, {'reason_category': 'If Body', 'usage_line': 76}, {'reason_category': 'Else Reasoning', 'usage_line': 77}, {'reason_category': 'Else Reasoning', 'usage_line': 78}, {'reason_category': 'Define Stop Criteria', 'usage_line': 80}, {'reason_category': 'Define Stop Crit...
Variable 'height' used at line 72 is defined at line 71 and has a Short-Range dependency. Variable 'factor' used at line 72 is defined at line 67 and has a Short-Range dependency. Variable 'width' used at line 73 is defined at line 71 and has a Short-Range dependency. Variable 'factor' used at line 73 is defined at lin...
{'If Condition': 1, 'If Body': 1, 'Else Reasoning': 2, 'Define Stop Criteria': 2, 'Loop Body': 1}
{'Variable Short-Range': 14, 'Library Long-Range': 2, 'Variable Loop Short-Range': 2, 'Variable Medium-Range': 2}
infilling_python
Image_Filtering
86
86
['import numpy as np', 'import cv2', 'import matplotlib.pyplot as plt', 'from scipy.signal import convolve2d', 'from scipy.signal import butter, filtfilt', '', '# Task1', '# Gaussian blurring einstein monroe illusion', 'def gaussian2D(sigma, kernel_size):', ' sigma_x, sigma_y = sigma', ' size_x, size_y = kernel_s...
['downsampled_image = downsample_image(img_c, downsampling_factor)']
['print(np.array(downsampled_image))', '', '# Part3', '# Computer fourier magnitude for the final image, original grayscale images, ', '# the blurred second image and difference between grayscale first image and blurred first image', '', 'def compute_fourier_magnitude(image):', ' spectrum = np.abs(np.fft.fftshift(np...
[]
Variable 'img_c' used at line 86 is defined at line 64 and has a Medium-Range dependency. Variable 'downsampling_factor' used at line 86 is defined at line 85 and has a Short-Range dependency.
{}
{'Variable Medium-Range': 1, 'Variable Short-Range': 1}