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
infilling_python
Image_Filtering
94
96
['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...
[' spectrum = np.abs(np.fft.fftshift(np.fft.fft2(image)))', ' log_spectrum = np.log(1 + spectrum)', ' return log_spectrum']
['', 'spectrum_A = compute_fourier_magnitude(img_a_gray)', 'spectrum_B = compute_fourier_magnitude(img_b_gray)', 'spectrum_blurred_B = compute_fourier_magnitude(blur_b)', 'spectrum_A_blur_A = compute_fourier_magnitude(a_diff)', 'spectrum_C = compute_fourier_magnitude(img_c)', 'print(spectrum_A)', 'print(spectrum_B)', '...
[]
Library 'np' used at line 94 is imported at line 1 and has a Long-Range dependency. Variable 'image' used at line 94 is defined at line 93 and has a Short-Range dependency. Library 'np' used at line 95 is imported at line 1 and has a Long-Range dependency. Variable 'spectrum' used at line 95 is defined at line 94 and h...
{}
{'Library Long-Range': 2, 'Variable Short-Range': 3}
infilling_python
Image_Filtering
95
96
['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...
[' log_spectrum = np.log(1 + spectrum)', ' return log_spectrum']
['', 'spectrum_A = compute_fourier_magnitude(img_a_gray)', 'spectrum_B = compute_fourier_magnitude(img_b_gray)', 'spectrum_blurred_B = compute_fourier_magnitude(blur_b)', 'spectrum_A_blur_A = compute_fourier_magnitude(a_diff)', 'spectrum_C = compute_fourier_magnitude(img_c)', 'print(spectrum_A)', 'print(spectrum_B)', '...
[]
Library 'np' used at line 95 is imported at line 1 and has a Long-Range dependency. Variable 'spectrum' used at line 95 is defined at line 94 and has a Short-Range dependency. Variable 'log_spectrum' used at line 96 is defined at line 95 and has a Short-Range dependency.
{}
{'Library Long-Range': 1, 'Variable Short-Range': 2}
infilling_python
Image_Filtering
99
99
['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...
['spectrum_B = compute_fourier_magnitude(img_b_gray)']
['spectrum_blurred_B = compute_fourier_magnitude(blur_b)', 'spectrum_A_blur_A = compute_fourier_magnitude(a_diff)', 'spectrum_C = compute_fourier_magnitude(img_c)', 'print(spectrum_A)', 'print(spectrum_B)', 'print(spectrum_A_blur_A)', 'print(spectrum_blurred_B)', 'print(spectrum_C)', '', '# Blend two images with a vert...
[]
Function 'compute_fourier_magnitude' used at line 99 is defined at line 93 and has a Short-Range dependency. Variable 'img_b_gray' used at line 99 is defined at line 45 and has a Long-Range dependency.
{}
{'Function Short-Range': 1, 'Variable Long-Range': 1}
infilling_python
Image_Filtering
100
100
['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...
['spectrum_blurred_B = compute_fourier_magnitude(blur_b)']
['spectrum_A_blur_A = compute_fourier_magnitude(a_diff)', 'spectrum_C = compute_fourier_magnitude(img_c)', 'print(spectrum_A)', 'print(spectrum_B)', 'print(spectrum_A_blur_A)', 'print(spectrum_blurred_B)', 'print(spectrum_C)', '', '# Blend two images with a verticle blend in the middle with laplacian pyramids', '# Part...
[]
Function 'compute_fourier_magnitude' used at line 100 is defined at line 93 and has a Short-Range dependency. Variable 'blur_b' used at line 100 is defined at line 61 and has a Long-Range dependency.
{}
{'Function Short-Range': 1, 'Variable Long-Range': 1}
infilling_python
Image_Filtering
101
101
['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...
['spectrum_A_blur_A = compute_fourier_magnitude(a_diff)']
['spectrum_C = compute_fourier_magnitude(img_c)', 'print(spectrum_A)', 'print(spectrum_B)', 'print(spectrum_A_blur_A)', 'print(spectrum_blurred_B)', 'print(spectrum_C)', '', '# Blend two images with a verticle blend in the middle with laplacian pyramids', '# Part 1 vertical blending halfway through image', "apple = cv2...
[]
Function 'compute_fourier_magnitude' used at line 101 is defined at line 93 and has a Short-Range dependency. Variable 'a_diff' used at line 101 is defined at line 63 and has a Long-Range dependency.
{}
{'Function Short-Range': 1, 'Variable Long-Range': 1}
infilling_python
Image_Filtering
102
102
['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...
['spectrum_C = compute_fourier_magnitude(img_c)']
['print(spectrum_A)', 'print(spectrum_B)', 'print(spectrum_A_blur_A)', 'print(spectrum_blurred_B)', 'print(spectrum_C)', '', '# Blend two images with a verticle blend in the middle with laplacian pyramids', '# Part 1 vertical blending halfway through image', "apple = cv2.imread('./apple.jpeg')", "orange = cv2.imread('....
[]
Function 'compute_fourier_magnitude' used at line 102 is defined at line 93 and has a Short-Range dependency. Variable 'img_c' used at line 102 is defined at line 64 and has a Long-Range dependency.
{}
{'Function Short-Range': 1, 'Variable Long-Range': 1}
infilling_python
Image_Filtering
114
114
['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...
['B = cv2.resize(orange, (256,256), fx=0.5, fy=0.5)']
['', 'G = A.copy()', 'gpA = [G]', 'for i in range(6):', ' G = cv2.pyrDown(G)', ' gpA.append(G)', '', '# Gaussian pyramid for B', 'G = B.copy()', 'gpB = [G]', 'for i in range(6):', ' G = cv2.pyrDown(G)', ' gpB.append(G)', '', '# Laplacian Pyramid for A and B', 'lpA = [gpA[5]]', 'for i in range(5,0,-1):', ' ...
[]
Library 'cv2' used at line 114 is imported at line 2 and has a Long-Range dependency. Variable 'orange' used at line 114 is defined at line 112 and has a Short-Range dependency.
{}
{'Library Long-Range': 1, 'Variable Short-Range': 1}
infilling_python
Image_Filtering
118
120
['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(6):', ' G = cv2.pyrDown(G)', ' gpA.append(G)']
['', '# Gaussian pyramid for B', 'G = B.copy()', 'gpB = [G]', 'for i in range(6):', ' G = cv2.pyrDown(G)', ' gpB.append(G)', '', '# Laplacian Pyramid for A and B', 'lpA = [gpA[5]]', 'for i in range(5,0,-1):', ' GE = cv2.pyrUp(gpA[i])', ' L = cv2.subtract(gpA[i-1],GE)', ' lpA.append(L)', '', 'lpB = [gpB[5...
[{'reason_category': 'Define Stop Criteria', 'usage_line': 118}, {'reason_category': 'Loop Body', 'usage_line': 119}, {'reason_category': 'Loop Body', 'usage_line': 120}]
Library 'cv2' used at line 119 is imported at line 2 and has a Long-Range dependency. Variable 'G' used at line 119 is defined at line 116 and has a Short-Range dependency. Variable 'gpA' used at line 120 is defined at line 117 and has a Short-Range dependency. Variable 'G' used at line 120 is defined at line 119 and h...
{'Define Stop Criteria': 1, 'Loop Body': 2}
{'Library Long-Range': 1, 'Variable Short-Range': 3}
infilling_python
Image_Filtering
123
127
['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...
['G = B.copy()', 'gpB = [G]', 'for i in range(6):', ' G = cv2.pyrDown(G)', ' gpB.append(G)']
['', '# Laplacian Pyramid for A and B', 'lpA = [gpA[5]]', 'for i in range(5,0,-1):', ' GE = cv2.pyrUp(gpA[i])', ' L = cv2.subtract(gpA[i-1],GE)', ' lpA.append(L)', '', 'lpB = [gpB[5]]', 'for i in range(5,0,-1):', ' GE = cv2.pyrUp(gpB[i])', ' L = cv2.subtract(gpB[i-1],GE)', ' lpB.append(L)', '', '# Add...
[{'reason_category': 'Define Stop Criteria', 'usage_line': 125}, {'reason_category': 'Loop Body', 'usage_line': 126}, {'reason_category': 'Loop Body', 'usage_line': 127}]
Variable 'B' used at line 123 is defined at line 114 and has a Short-Range dependency. Variable 'G' used at line 124 is defined at line 123 and has a Short-Range dependency. Library 'cv2' used at line 126 is imported at line 2 and has a Long-Range dependency. Variable 'G' used at line 126 is defined at line 123 and has...
{'Define Stop Criteria': 1, 'Loop Body': 2}
{'Variable Short-Range': 5, 'Library Long-Range': 1}
infilling_python
Image_Filtering
132
134
['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...
[' GE = cv2.pyrUp(gpA[i])', ' L = cv2.subtract(gpA[i-1],GE)', ' lpA.append(L)']
['', 'lpB = [gpB[5]]', 'for i in range(5,0,-1):', ' GE = cv2.pyrUp(gpB[i])', ' L = cv2.subtract(gpB[i-1],GE)', ' lpB.append(L)', '', '# Add left and right halves of images in each level', 'LS = []', 'for la,lb in zip(lpA,lpB):', ' rows,cols,dpt = la.shape', ' ls = np.hstack((la[:,0:cols//2], lb[:,cols//2...
[{'reason_category': 'Loop Body', 'usage_line': 132}, {'reason_category': 'Loop Body', 'usage_line': 133}, {'reason_category': 'Loop Body', 'usage_line': 134}]
Library 'cv2' used at line 132 is imported at line 2 and has a Long-Range dependency. Variable 'gpA' used at line 132 is defined at line 117 and has a Medium-Range dependency. Variable 'i' used at line 132 is part of a Loop defined at line 131 and has a Short-Range dependency. Library 'cv2' used at line 133 is imported...
{'Loop Body': 3}
{'Library Long-Range': 2, 'Variable Medium-Range': 2, 'Variable Loop Short-Range': 2, 'Variable Short-Range': 3}
infilling_python
Image_Filtering
138
140
['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...
[' GE = cv2.pyrUp(gpB[i])', ' L = cv2.subtract(gpB[i-1],GE)', ' lpB.append(L)']
['', '# Add left and right halves of images in each level', 'LS = []', 'for la,lb in zip(lpA,lpB):', ' rows,cols,dpt = la.shape', ' ls = np.hstack((la[:,0:cols//2], lb[:,cols//2:]))', ' LS.append(ls)', '', '# Reconstruct', 'ls_ = LS[0]', 'for i in range(1,6):', ' ls_ = cv2.pyrUp(ls_)', ' ls_ = cv2.add(ls...
[{'reason_category': 'Loop Body', 'usage_line': 138}, {'reason_category': 'Loop Body', 'usage_line': 139}, {'reason_category': 'Loop Body', 'usage_line': 140}]
Library 'cv2' used at line 138 is imported at line 2 and has a Long-Range dependency. Variable 'gpB' used at line 138 is defined at line 124 and has a Medium-Range dependency. Variable 'i' used at line 138 is part of a Loop defined at line 137 and has a Short-Range dependency. Library 'cv2' used at line 139 is imported...
{'Loop Body': 3}
{'Library Long-Range': 2, 'Variable Medium-Range': 2, 'Variable Loop Short-Range': 2, 'Variable Short-Range': 3}
infilling_python
Image_Filtering
144
147
['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 la,lb in zip(lpA,lpB):', ' rows,cols,dpt = la.shape', ' ls = np.hstack((la[:,0:cols//2], lb[:,cols//2:]))', ' LS.append(ls)']
['', '# Reconstruct', 'ls_ = LS[0]', 'for i in range(1,6):', ' ls_ = cv2.pyrUp(ls_)', ' ls_ = cv2.add(ls_, LS[i])', '', '# Image with direct connecting each half', 'real = np.hstack((A[:,:cols//2],B[:,cols//2:]))', '', 'blended_rgb = cv2.cvtColor(ls_, cv2.COLOR_BGR2RGB)', 'original_rgb = cv2.cvtColor(real, cv2.CO...
[{'reason_category': 'Define Stop Criteria', 'usage_line': 144}, {'reason_category': 'Loop Body', 'usage_line': 145}, {'reason_category': 'Loop Body', 'usage_line': 146}, {'reason_category': 'Loop Body', 'usage_line': 147}]
Variable 'lpA' used at line 144 is defined at line 130 and has a Medium-Range dependency. Variable 'lpB' used at line 144 is defined at line 136 and has a Short-Range dependency. Variable 'la' used at line 145 is part of a Loop defined at line 144 and has a Short-Range dependency. Library 'np' used at line 146 is impor...
{'Define Stop Criteria': 1, 'Loop Body': 3}
{'Variable Medium-Range': 1, 'Variable Short-Range': 4, 'Variable Loop Short-Range': 3, 'Library Long-Range': 1}
infilling_python
Image_Filtering
145
147
['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...
[' rows,cols,dpt = la.shape', ' ls = np.hstack((la[:,0:cols//2], lb[:,cols//2:]))', ' LS.append(ls)']
['', '# Reconstruct', 'ls_ = LS[0]', 'for i in range(1,6):', ' ls_ = cv2.pyrUp(ls_)', ' ls_ = cv2.add(ls_, LS[i])', '', '# Image with direct connecting each half', 'real = np.hstack((A[:,:cols//2],B[:,cols//2:]))', '', 'blended_rgb = cv2.cvtColor(ls_, cv2.COLOR_BGR2RGB)', 'original_rgb = cv2.cvtColor(real, cv2.CO...
[{'reason_category': 'Loop Body', 'usage_line': 145}, {'reason_category': 'Loop Body', 'usage_line': 146}, {'reason_category': 'Loop Body', 'usage_line': 147}]
Variable 'la' used at line 145 is part of a Loop defined at line 144 and has a Short-Range dependency. Library 'np' used at line 146 is imported at line 1 and has a Long-Range dependency. Variable 'la' used at line 146 is part of a Loop defined at line 144 and has a Short-Range dependency. Variable 'cols' used at line ...
{'Loop Body': 3}
{'Variable Loop Short-Range': 3, 'Library Long-Range': 1, 'Variable Short-Range': 3}
infilling_python
Image_Filtering
146
147
['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...
[' ls = np.hstack((la[:,0:cols//2], lb[:,cols//2:]))', ' LS.append(ls)']
['', '# Reconstruct', 'ls_ = LS[0]', 'for i in range(1,6):', ' ls_ = cv2.pyrUp(ls_)', ' ls_ = cv2.add(ls_, LS[i])', '', '# Image with direct connecting each half', 'real = np.hstack((A[:,:cols//2],B[:,cols//2:]))', '', 'blended_rgb = cv2.cvtColor(ls_, cv2.COLOR_BGR2RGB)', 'original_rgb = cv2.cvtColor(real, cv2.CO...
[{'reason_category': 'Loop Body', 'usage_line': 146}, {'reason_category': 'Loop Body', 'usage_line': 147}]
Library 'np' used at line 146 is imported at line 1 and has a Long-Range dependency. Variable 'la' used at line 146 is part of a Loop defined at line 144 and has a Short-Range dependency. Variable 'cols' used at line 146 is defined at line 145 and has a Short-Range dependency. Variable 'lb' used at line 146 is part of ...
{'Loop Body': 2}
{'Library Long-Range': 1, 'Variable Loop Short-Range': 2, 'Variable Short-Range': 3}
infilling_python
Image_Filtering
152
153
['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...
[' ls_ = cv2.pyrUp(ls_)', ' ls_ = cv2.add(ls_, LS[i])']
['', '# Image with direct connecting each half', 'real = np.hstack((A[:,:cols//2],B[:,cols//2:]))', '', 'blended_rgb = cv2.cvtColor(ls_, cv2.COLOR_BGR2RGB)', 'original_rgb = cv2.cvtColor(real, cv2.COLOR_BGR2RGB)', '', 'print(blended_rgb)', 'print(original_rgb)', '', '# Part 2', '# Blend the image diagonally in a strip ...
[{'reason_category': 'Loop Body', 'usage_line': 152}, {'reason_category': 'Loop Body', 'usage_line': 153}]
Library 'cv2' used at line 152 is imported at line 2 and has a Long-Range dependency. Variable 'ls_' used at line 152 is defined at line 150 and has a Short-Range dependency. Library 'cv2' used at line 153 is imported at line 2 and has a Long-Range dependency. Variable 'LS' used at line 153 is defined at line 143 and h...
{'Loop Body': 2}
{'Library Long-Range': 2, 'Variable Short-Range': 2, 'Variable Loop Short-Range': 1}
infilling_python
Image_Filtering
156
156
['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...
['real = np.hstack((A[:,:cols//2],B[:,cols//2:]))']
['', 'blended_rgb = cv2.cvtColor(ls_, cv2.COLOR_BGR2RGB)', 'original_rgb = cv2.cvtColor(real, cv2.COLOR_BGR2RGB)', '', 'print(blended_rgb)', 'print(original_rgb)', '', '# Part 2', '# Blend the image diagonally in a strip following the same steps as above ', '# to accomplish diagnoal blending, use a diagonal mask ', '# ...
[]
Library 'np' used at line 156 is imported at line 1 and has a Long-Range dependency. Variable 'A' used at line 156 is defined at line 113 and has a Long-Range dependency. Variable 'B' used at line 156 is defined at line 114 and has a Long-Range dependency.
{}
{'Library Long-Range': 1, 'Variable Long-Range': 2}
infilling_python
Image_Filtering
158
158
['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...
['blended_rgb = cv2.cvtColor(ls_, cv2.COLOR_BGR2RGB)']
['original_rgb = cv2.cvtColor(real, cv2.COLOR_BGR2RGB)', '', 'print(blended_rgb)', 'print(original_rgb)', '', '# Part 2', '# Blend the image diagonally in a strip following the same steps as above ', '# to accomplish diagnoal blending, use a diagonal mask ', '# Create diagonal mask', 'def create_diagonal_mask(shape, st...
[]
Library 'cv2' used at line 158 is imported at line 2 and has a Long-Range dependency. Variable 'ls_' used at line 158 is defined at line 150 and has a Short-Range dependency.
{}
{'Library Long-Range': 1, 'Variable Short-Range': 1}
infilling_python
Image_Filtering
159
159
['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...
['original_rgb = cv2.cvtColor(real, cv2.COLOR_BGR2RGB)']
['', 'print(blended_rgb)', 'print(original_rgb)', '', '# Part 2', '# Blend the image diagonally in a strip following the same steps as above ', '# to accomplish diagnoal blending, use a diagonal mask ', '# Create diagonal mask', 'def create_diagonal_mask(shape, strip_width=200):', ' mask = np.zeros(shape, dtype=np.f...
[]
Library 'cv2' used at line 159 is imported at line 2 and has a Long-Range dependency. Variable 'real' used at line 159 is defined at line 156 and has a Short-Range dependency.
{}
{'Library Long-Range': 1, 'Variable Short-Range': 1}
infilling_python
Image_Filtering
169
173
['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...
[' mask = np.zeros(shape, dtype=np.float32)', ' height, width, _ = mask.shape', ' for i in range(min(height, width)):', ' mask[i, max(0, i - strip_width // 2):min(width, i + strip_width // 2), :] = 1.0', ' return mask']
['', '# Now blend images using the diagonal mask', 'LS = []', 'mask = create_diagonal_mask(A.shape)', 'M = mask.copy()', 'gpmask = [M]', 'for i in range(5):', ' M = cv2.pyrDown(M)', ' gpmask.append(M)', 'gpmask.reverse()', 'for i in range(len(gpmask)):', ' rows, cols, dpt = lpA[i].shape', ' ls = lpA[i] * gp...
[{'reason_category': 'Define Stop Criteria', 'usage_line': 171}, {'reason_category': 'Loop Body', 'usage_line': 172}]
Library 'np' used at line 169 is imported at line 1 and has a Long-Range dependency. Variable 'shape' used at line 169 is defined at line 168 and has a Short-Range dependency. Variable 'mask' used at line 170 is defined at line 169 and has a Short-Range dependency. Variable 'height' used at line 171 is defined at line ...
{'Define Stop Criteria': 1, 'Loop Body': 1}
{'Library Long-Range': 1, 'Variable Short-Range': 8, 'Variable Loop Short-Range': 1}
infilling_python
Image_Filtering
171
173
['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(min(height, width)):', ' mask[i, max(0, i - strip_width // 2):min(width, i + strip_width // 2), :] = 1.0', ' return mask']
['', '# Now blend images using the diagonal mask', 'LS = []', 'mask = create_diagonal_mask(A.shape)', 'M = mask.copy()', 'gpmask = [M]', 'for i in range(5):', ' M = cv2.pyrDown(M)', ' gpmask.append(M)', 'gpmask.reverse()', 'for i in range(len(gpmask)):', ' rows, cols, dpt = lpA[i].shape', ' ls = lpA[i] * gp...
[{'reason_category': 'Define Stop Criteria', 'usage_line': 171}, {'reason_category': 'Loop Body', 'usage_line': 172}]
Variable 'height' used at line 171 is defined at line 170 and has a Short-Range dependency. Variable 'width' used at line 171 is defined at line 170 and has a Short-Range dependency. Variable 'mask' used at line 172 is defined at line 169 and has a Short-Range dependency. Variable 'i' used at line 172 is part of a Loop...
{'Define Stop Criteria': 1, 'Loop Body': 1}
{'Variable Short-Range': 6, 'Variable Loop Short-Range': 1}
infilling_python
Image_Filtering
177
177
['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...
['mask = create_diagonal_mask(A.shape)']
['M = mask.copy()', 'gpmask = [M]', 'for i in range(5):', ' M = cv2.pyrDown(M)', ' gpmask.append(M)', 'gpmask.reverse()', 'for i in range(len(gpmask)):', ' rows, cols, dpt = lpA[i].shape', ' ls = lpA[i] * gpmask[i] + lpB[i] * (1 - gpmask[i])', ' LS.append(ls)', '', '# Now reconstruct', 'ls_ = LS[0]', 'fo...
[]
Function 'create_diagonal_mask' used at line 177 is defined at line 168 and has a Short-Range dependency. Variable 'A' used at line 177 is defined at line 113 and has a Long-Range dependency.
{}
{'Function Short-Range': 1, 'Variable Long-Range': 1}
infilling_python
Image_Filtering
181
182
['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...
[' M = cv2.pyrDown(M)', ' gpmask.append(M)']
['gpmask.reverse()', 'for i in range(len(gpmask)):', ' rows, cols, dpt = lpA[i].shape', ' ls = lpA[i] * gpmask[i] + lpB[i] * (1 - gpmask[i])', ' LS.append(ls)', '', '# Now reconstruct', 'ls_ = LS[0]', 'for i in range(1, 6):', ' ls_ = cv2.pyrUp(ls_)', ' ls_ = cv2.resize(ls_, (LS[i].shape[1], LS[i].shape[0...
[{'reason_category': 'Loop Body', 'usage_line': 181}, {'reason_category': 'Loop Body', 'usage_line': 182}]
Library 'cv2' used at line 181 is imported at line 2 and has a Long-Range dependency. Variable 'M' used at line 181 is defined at line 178 and has a Short-Range dependency. Variable 'gpmask' used at line 182 is defined at line 179 and has a Short-Range dependency. Variable 'M' used at line 182 is defined at line 181 an...
{'Loop Body': 2}
{'Library Long-Range': 1, 'Variable Short-Range': 3}
infilling_python
Image_Filtering
185
187
['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...
[' rows, cols, dpt = lpA[i].shape', ' ls = lpA[i] * gpmask[i] + lpB[i] * (1 - gpmask[i])', ' LS.append(ls)']
['', '# Now reconstruct', 'ls_ = LS[0]', 'for i in range(1, 6):', ' ls_ = cv2.pyrUp(ls_)', ' ls_ = cv2.resize(ls_, (LS[i].shape[1], LS[i].shape[0])) ', ' ls_ = cv2.add(ls_, LS[i])', '', '# Image with direct connecting each diagonal half', 'real = np.hstack((A[:, :cols//2], B[:, cols//2:]))', 'ls_rgb = cv2.cvtC...
[{'reason_category': 'Loop Body', 'usage_line': 185}, {'reason_category': 'Loop Body', 'usage_line': 186}, {'reason_category': 'Loop Body', 'usage_line': 187}]
Variable 'lpA' used at line 185 is defined at line 130 and has a Long-Range dependency. Variable 'i' used at line 185 is part of a Loop defined at line 184 and has a Short-Range dependency. Variable 'lpA' used at line 186 is defined at line 130 and has a Long-Range dependency. Variable 'i' used at line 186 is part of a...
{'Loop Body': 3}
{'Variable Long-Range': 3, 'Variable Loop Short-Range': 2, 'Variable Short-Range': 2, 'Variable Medium-Range': 1}
infilling_python
Image_Filtering
192
194
['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...
[' ls_ = cv2.pyrUp(ls_)', ' ls_ = cv2.resize(ls_, (LS[i].shape[1], LS[i].shape[0])) ', ' ls_ = cv2.add(ls_, LS[i])']
['', '# Image with direct connecting each diagonal half', 'real = np.hstack((A[:, :cols//2], B[:, cols//2:]))', 'ls_rgb = cv2.cvtColor(ls_.astype(np.uint8), cv2.COLOR_BGR2RGB)', 'real_rgb = cv2.cvtColor(real, cv2.COLOR_BGR2RGB)', '', 'print(ls_rgb)', 'print(real_rgb)', 'print(mask)', '', '', '# Task3', '# Part1', '# Re...
[{'reason_category': 'Loop Body', 'usage_line': 192}, {'reason_category': 'Loop Body', 'usage_line': 193}, {'reason_category': 'Loop Body', 'usage_line': 194}]
Library 'cv2' used at line 192 is imported at line 2 and has a Long-Range dependency. Variable 'ls_' used at line 192 is defined at line 190 and has a Short-Range dependency. Library 'cv2' used at line 193 is imported at line 2 and has a Long-Range dependency. Variable 'ls_' used at line 193 is defined at line 192 and ...
{'Loop Body': 3}
{'Library Long-Range': 3, 'Variable Short-Range': 3, 'Variable Medium-Range': 2, 'Variable Loop Short-Range': 2}
infilling_python
Image_Filtering
197
197
['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...
['real = np.hstack((A[:, :cols//2], B[:, cols//2:]))']
['ls_rgb = cv2.cvtColor(ls_.astype(np.uint8), cv2.COLOR_BGR2RGB)', 'real_rgb = cv2.cvtColor(real, cv2.COLOR_BGR2RGB)', '', 'print(ls_rgb)', 'print(real_rgb)', 'print(mask)', '', '', '# Task3', '# Part1', '# Read in a video file in .avi format, choose areas of the face to focus on via bounding box', '# Apply a bandpass ...
[]
Library 'np' used at line 197 is imported at line 1 and has a Long-Range dependency. Variable 'A' used at line 197 is defined at line 113 and has a Long-Range dependency. Variable 'B' used at line 197 is defined at line 114 and has a Long-Range dependency.
{}
{'Library Long-Range': 1, 'Variable Long-Range': 2}
infilling_python
Image_Filtering
198
198
['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...
['ls_rgb = cv2.cvtColor(ls_.astype(np.uint8), cv2.COLOR_BGR2RGB)']
['real_rgb = cv2.cvtColor(real, cv2.COLOR_BGR2RGB)', '', 'print(ls_rgb)', 'print(real_rgb)', 'print(mask)', '', '', '# Task3', '# Part1', '# Read in a video file in .avi format, choose areas of the face to focus on via bounding box', '# Apply a bandpass filter to the specified regions of the interest based on a lower a...
[]
Library 'cv2' used at line 198 is imported at line 2 and has a Long-Range dependency. Variable 'ls_' used at line 198 is defined at line 190 and has a Short-Range dependency. Library 'np' used at line 198 is imported at line 1 and has a Long-Range dependency.
{}
{'Library Long-Range': 2, 'Variable Short-Range': 1}
infilling_python
Image_Filtering
199
199
['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...
['real_rgb = cv2.cvtColor(real, cv2.COLOR_BGR2RGB)']
['', 'print(ls_rgb)', 'print(real_rgb)', 'print(mask)', '', '', '# Task3', '# Part1', '# Read in a video file in .avi format, choose areas of the face to focus on via bounding box', '# Apply a bandpass filter to the specified regions of the interest based on a lower and upper bound', 'def read_video_into_numpy(filename...
[]
Library 'cv2' used at line 199 is imported at line 2 and has a Long-Range dependency. Variable 'real' used at line 199 is defined at line 197 and has a Short-Range dependency.
{}
{'Library Long-Range': 1, 'Variable Short-Range': 1}
infilling_python
Image_Filtering
211
211
['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...
[' cap = cv2.VideoCapture(filename)']
[' frames = []', ' while cap.isOpened():', ' ret, frame = cap.read()', ' # if frame is read correctly ret is True', ' if not ret:', ' print("Can\'t receive frame (stream end?). Exiting ...")', ' break', '', ' frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)', ' f...
[]
Library 'cv2' used at line 211 is imported at line 2 and has a Long-Range dependency. Variable 'filename' used at line 211 is defined at line 210 and has a Short-Range dependency.
{}
{'Library Long-Range': 1, 'Variable Short-Range': 1}
infilling_python
Image_Filtering
220
221
['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...
[' frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)', ' frames.append(frame)']
['', ' cap.release()', ' # Converts to numpy array(T,H,W,C)', ' video = np.stack(frames, axis=0)', ' # (T,H,W,C)->(H,W,C,T)', ' video = np.transpose(video, (1,2,3,0))', ' return frames', '', 'def bandpass_filter(signal, low_cutoff, high_cutoff, fs, order):', ' nyquist = 0.5 * fs', ' low = low_cu...
[{'reason_category': 'Loop Body', 'usage_line': 220}, {'reason_category': 'Loop Body', 'usage_line': 221}]
Library 'cv2' used at line 220 is imported at line 2 and has a Long-Range dependency. Variable 'frame' used at line 220 is defined at line 214 and has a Short-Range dependency. Variable 'frames' used at line 221 is defined at line 212 and has a Short-Range dependency. Variable 'frame' used at line 221 is defined at lin...
{'Loop Body': 2}
{'Library Long-Range': 1, 'Variable Short-Range': 3}
infilling_python
Image_Filtering
231
236
['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...
[' nyquist = 0.5 * fs', ' low = low_cutoff / nyquist', ' high = high_cutoff / nyquist', " b, a = butter(order, [low, high], btype='band')", ' filtered_signal = filtfilt(b, a, signal)', ' return filtered_signal']
['', "alice = './alice.avi'", 'video_frames = read_video_into_numpy(alice)', 'first_frame = video_frames[0]', '', '# Specify regions of interest', 'cheek_rect = [(220, 250), (320, 350)]', 'forehead_rect = [(220, 10), (500, 174)]', 'cheek_roi = first_frame[cheek_rect[0][1]:cheek_rect[1][1], cheek_rect[0][0]:cheek_rect[1...
[]
Variable 'fs' used at line 231 is defined at line 230 and has a Short-Range dependency. Variable 'low_cutoff' used at line 232 is defined at line 230 and has a Short-Range dependency. Variable 'nyquist' used at line 232 is defined at line 231 and has a Short-Range dependency. Variable 'high_cutoff' used at line 233 is ...
{}
{'Variable Short-Range': 12, 'Library Long-Range': 2}
infilling_python
Image_Filtering
233
233
['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...
[' high = high_cutoff / nyquist']
[" b, a = butter(order, [low, high], btype='band')", ' filtered_signal = filtfilt(b, a, signal)', ' return filtered_signal', '', "alice = './alice.avi'", 'video_frames = read_video_into_numpy(alice)', 'first_frame = video_frames[0]', '', '# Specify regions of interest', 'cheek_rect = [(220, 250), (320, 350)]',...
[]
Variable 'high_cutoff' used at line 233 is defined at line 230 and has a Short-Range dependency. Variable 'nyquist' used at line 233 is defined at line 231 and has a Short-Range dependency.
{}
{'Variable Short-Range': 2}
infilling_python
Image_Filtering
234
234
['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...
[" b, a = butter(order, [low, high], btype='band')"]
[' filtered_signal = filtfilt(b, a, signal)', ' return filtered_signal', '', "alice = './alice.avi'", 'video_frames = read_video_into_numpy(alice)', 'first_frame = video_frames[0]', '', '# Specify regions of interest', 'cheek_rect = [(220, 250), (320, 350)]', 'forehead_rect = [(220, 10), (500, 174)]', 'cheek_roi ...
[]
Library 'butter' used at line 234 is imported at line 5 and has a Long-Range dependency. Variable 'order' used at line 234 is defined at line 230 and has a Short-Range dependency. Variable 'low' used at line 234 is defined at line 232 and has a Short-Range dependency. Variable 'high' used at line 234 is defined at line...
{}
{'Library Long-Range': 1, 'Variable Short-Range': 3}
infilling_python
Image_Filtering
235
236
['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...
[' filtered_signal = filtfilt(b, a, signal)', ' return filtered_signal']
['', "alice = './alice.avi'", 'video_frames = read_video_into_numpy(alice)', 'first_frame = video_frames[0]', '', '# Specify regions of interest', 'cheek_rect = [(220, 250), (320, 350)]', 'forehead_rect = [(220, 10), (500, 174)]', 'cheek_roi = first_frame[cheek_rect[0][1]:cheek_rect[1][1], cheek_rect[0][0]:cheek_rect[1...
[]
Library 'filtfilt' used at line 235 is imported at line 5 and has a Long-Range dependency. Variable 'b' used at line 235 is defined at line 234 and has a Short-Range dependency. Variable 'a' used at line 235 is defined at line 234 and has a Short-Range dependency. Variable 'signal' used at line 235 is defined at line 2...
{}
{'Library Long-Range': 1, 'Variable Short-Range': 4}
infilling_python
Image_Filtering
245
245
['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...
['cheek_roi = first_frame[cheek_rect[0][1]:cheek_rect[1][1], cheek_rect[0][0]:cheek_rect[1][0]]']
['forehead_roi = first_frame[forehead_rect[0][1]:forehead_rect[1][1], forehead_rect[0][0]:forehead_rect[1][0]]', '', 'print(cheek_roi)', 'print(forehead_roi)', '', '# Part 2', '# Find the average green value for each frame in the cheek and forhead region of interest', 'cheek_avg_green_values = []', 'forehead_avg_green_...
[]
Variable 'first_frame' used at line 245 is defined at line 240 and has a Short-Range dependency. Variable 'cheek_rect' used at line 245 is defined at line 243 and has a Short-Range dependency.
{}
{'Variable Short-Range': 2}
infilling_python
Image_Filtering
246
246
['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...
['forehead_roi = first_frame[forehead_rect[0][1]:forehead_rect[1][1], forehead_rect[0][0]:forehead_rect[1][0]]']
['', 'print(cheek_roi)', 'print(forehead_roi)', '', '# Part 2', '# Find the average green value for each frame in the cheek and forhead region of interest', 'cheek_avg_green_values = []', 'forehead_avg_green_values = []', '', 'for frame in video_frames:', ' cheek_roi = frame[cheek_rect[0][1]:cheek_rect[1][1], cheek_...
[]
Variable 'first_frame' used at line 246 is defined at line 240 and has a Short-Range dependency. Variable 'forehead_rect' used at line 246 is defined at line 244 and has a Short-Range dependency.
{}
{'Variable Short-Range': 2}
infilling_python
Image_Filtering
257
258
['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...
[' cheek_roi = frame[cheek_rect[0][1]:cheek_rect[1][1], cheek_rect[0][0]:cheek_rect[1][0]]', ' forehead_roi = frame[forehead_rect[0][1]:forehead_rect[1][1], forehead_rect[0][0]:forehead_rect[1][0]]']
[' cheek_avg_green = np.mean(cheek_roi[:, :, 1])', ' forehead_avg_green = np.mean(forehead_roi[:, :, 1])', ' cheek_avg_green_values.append(cheek_avg_green)', ' forehead_avg_green_values.append(forehead_avg_green)', '', 'print(cheek_avg_green_values)', 'print(forehead_avg_green_values)', '', '# Part3', '# Se...
[{'reason_category': 'Loop Body', 'usage_line': 257}, {'reason_category': 'Loop Body', 'usage_line': 258}]
Variable 'frame' used at line 257 is part of a Loop defined at line 256 and has a Short-Range dependency. Variable 'cheek_rect' used at line 257 is defined at line 243 and has a Medium-Range dependency. Variable 'frame' used at line 258 is part of a Loop defined at line 256 and has a Short-Range dependency. Variable 'f...
{'Loop Body': 2}
{'Variable Loop Short-Range': 2, 'Variable Medium-Range': 2}
infilling_python
Image_Filtering
259
259
['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...
[' cheek_avg_green = np.mean(cheek_roi[:, :, 1])']
[' forehead_avg_green = np.mean(forehead_roi[:, :, 1])', ' cheek_avg_green_values.append(cheek_avg_green)', ' forehead_avg_green_values.append(forehead_avg_green)', '', 'print(cheek_avg_green_values)', 'print(forehead_avg_green_values)', '', '# Part3', '# Set a lower and upper threshold and apply a bandpass fi...
[{'reason_category': 'Loop Body', 'usage_line': 259}]
Library 'np' used at line 259 is imported at line 1 and has a Long-Range dependency. Variable 'cheek_roi' used at line 259 is defined at line 257 and has a Short-Range dependency.
{'Loop Body': 1}
{'Library Long-Range': 1, 'Variable Short-Range': 1}
infilling_python
Image_Filtering
260
260
['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...
[' forehead_avg_green = np.mean(forehead_roi[:, :, 1])']
[' cheek_avg_green_values.append(cheek_avg_green)', ' forehead_avg_green_values.append(forehead_avg_green)', '', 'print(cheek_avg_green_values)', 'print(forehead_avg_green_values)', '', '# Part3', '# Set a lower and upper threshold and apply a bandpass filter to the average green values of cheek and forward ', '#...
[{'reason_category': 'Loop Body', 'usage_line': 260}]
Library 'np' used at line 260 is imported at line 1 and has a Long-Range dependency. Variable 'forehead_roi' used at line 260 is defined at line 258 and has a Short-Range dependency.
{'Loop Body': 1}
{'Library Long-Range': 1, 'Variable Short-Range': 1}
infilling_python
Image_Filtering
262
262
['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...
[' forehead_avg_green_values.append(forehead_avg_green)']
['', 'print(cheek_avg_green_values)', 'print(forehead_avg_green_values)', '', '# Part3', '# Set a lower and upper threshold and apply a bandpass filter to the average green values of cheek and forward ', '# Set fs to 30', '', 'low_cutoff = 0.8', 'high_cutoff = 3', 'fs = 30', 'order = 1', '', 'cheek_filtered_signal = ba...
[{'reason_category': 'Loop Body', 'usage_line': 262}]
Variable 'forehead_avg_green_values' used at line 262 is defined at line 254 and has a Short-Range dependency. Variable 'forehead_avg_green' used at line 262 is defined at line 260 and has a Short-Range dependency.
{'Loop Body': 1}
{'Variable Short-Range': 2}
infilling_python
Image_Filtering
277
277
['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...
['forehead_filtered_signal = bandpass_filter(forehead_avg_green_values, low_cutoff, high_cutoff, fs, order)']
['', 'print(cheek_filtered_signal)', 'print(forehead_filtered_signal)', '', '# Part4', '# Plot the Fourier magnitudes of these two signals using the DFT, where the x-axis is', '# frequency (in Hertz) and y-axis is amplitude. DFT coefficients are ordered in terms of', '# integer indices, so you will have to convert the ...
[]
Function 'bandpass_filter' used at line 277 is defined at line 230 and has a Long-Range dependency. Variable 'forehead_avg_green_values' used at line 277 is defined at line 254 and has a Medium-Range dependency. Variable 'low_cutoff' used at line 277 is defined at line 271 and has a Short-Range dependency. Variable 'hi...
{}
{'Function Long-Range': 1, 'Variable Medium-Range': 1, 'Variable Short-Range': 4}
infilling_python
Image_Filtering
291
291
['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...
['forehead_fft = np.fft.fft(forehead_filtered_signal)']
['print(cheek_fft)', 'print(forehead_fft)', '', 'N = len(cheek_filtered_signal)', 'Fs = 30', 'freq_cheek = np.fft.fftfreq(N, d=1/Fs)', 'freq_forehead = np.fft.fftfreq(N, d=1/Fs)', 'print(np.abs(freq_cheek))', 'print(np.abs(freq_forehead))', '', '# Part5', "# Estimate the pulse rate by finding the index where np.abs(che...
[]
Library 'np' used at line 291 is imported at line 1 and has a Long-Range dependency. Variable 'forehead_filtered_signal' used at line 291 is defined at line 277 and has a Medium-Range dependency.
{}
{'Library Long-Range': 1, 'Variable Medium-Range': 1}
infilling_python
Image_Filtering
298
298
['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...
['freq_forehead = np.fft.fftfreq(N, d=1/Fs)']
['print(np.abs(freq_cheek))', 'print(np.abs(freq_forehead))', '', '# Part5', "# Estimate the pulse rate by finding the index where np.abs(cheek_fft) is at it's maximum", '# Cheek heart rate will be aprox 60*freq_cheek[index of max np.abs(cheek_fft)] -> same idea with forhead', '', 'index_max_cheek = np.argmax(np.abs(ch...
[]
Library 'np' used at line 298 is imported at line 1 and has a Long-Range dependency. Variable 'N' used at line 298 is defined at line 295 and has a Short-Range dependency. Variable 'Fs' used at line 298 is defined at line 296 and has a Short-Range dependency.
{}
{'Library Long-Range': 1, 'Variable Short-Range': 2}
infilling_python
Image_Filtering
306
306
['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...
['index_max_cheek = np.argmax(np.abs(cheek_fft))']
['index_max_forehead = np.argmax(np.abs(forehead_fft))', '', 'freq_max_cheek = freq_cheek[index_max_cheek]', 'freq_max_forehead = freq_forehead[index_max_forehead]', '', 'heart_rate_cheek = (freq_max_cheek) * 60', 'heart_rate_forehead = (freq_max_forehead) * 60', '', 'print(f"Heart Rate (Cheek): {heart_rate_cheek:.2f} ...
[]
Library 'np' used at line 306 is imported at line 1 and has a Long-Range dependency. Variable 'cheek_fft' used at line 306 is defined at line 290 and has a Medium-Range dependency.
{}
{'Library Long-Range': 1, 'Variable Medium-Range': 1}
infilling_python
Image_Filtering
307
307
['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...
['index_max_forehead = np.argmax(np.abs(forehead_fft))']
['', 'freq_max_cheek = freq_cheek[index_max_cheek]', 'freq_max_forehead = freq_forehead[index_max_forehead]', '', 'heart_rate_cheek = (freq_max_cheek) * 60', 'heart_rate_forehead = (freq_max_forehead) * 60', '', 'print(f"Heart Rate (Cheek): {heart_rate_cheek:.2f} beats per minute")', 'print(f"Heart Rate (Forehead): {he...
[]
Library 'np' used at line 307 is imported at line 1 and has a Long-Range dependency. Variable 'forehead_fft' used at line 307 is defined at line 291 and has a Medium-Range dependency.
{}
{'Library Long-Range': 1, 'Variable Medium-Range': 1}
infilling_python
Image_Filtering
309
309
['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...
['freq_max_cheek = freq_cheek[index_max_cheek]']
['freq_max_forehead = freq_forehead[index_max_forehead]', '', 'heart_rate_cheek = (freq_max_cheek) * 60', 'heart_rate_forehead = (freq_max_forehead) * 60', '', 'print(f"Heart Rate (Cheek): {heart_rate_cheek:.2f} beats per minute")', 'print(f"Heart Rate (Forehead): {heart_rate_forehead:.2f} beats per minute")']
[]
Variable 'freq_cheek' used at line 309 is defined at line 297 and has a Medium-Range dependency. Variable 'index_max_cheek' used at line 309 is defined at line 306 and has a Short-Range dependency.
{}
{'Variable Medium-Range': 1, 'Variable Short-Range': 1}
infilling_python
Image_Filtering
310
310
['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...
['freq_max_forehead = freq_forehead[index_max_forehead]']
['', 'heart_rate_cheek = (freq_max_cheek) * 60', 'heart_rate_forehead = (freq_max_forehead) * 60', '', 'print(f"Heart Rate (Cheek): {heart_rate_cheek:.2f} beats per minute")', 'print(f"Heart Rate (Forehead): {heart_rate_forehead:.2f} beats per minute")']
[]
Variable 'freq_forehead' used at line 310 is defined at line 298 and has a Medium-Range dependency. Variable 'index_max_forehead' used at line 310 is defined at line 307 and has a Short-Range dependency.
{}
{'Variable Medium-Range': 1, 'Variable Short-Range': 1}
infilling_python
Image_Filtering
312
313
['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...
['heart_rate_cheek = (freq_max_cheek) * 60', 'heart_rate_forehead = (freq_max_forehead) * 60']
['', 'print(f"Heart Rate (Cheek): {heart_rate_cheek:.2f} beats per minute")', 'print(f"Heart Rate (Forehead): {heart_rate_forehead:.2f} beats per minute")']
[]
Variable 'freq_max_cheek' used at line 312 is defined at line 309 and has a Short-Range dependency. Variable 'freq_max_forehead' used at line 313 is defined at line 310 and has a Short-Range dependency.
{}
{'Variable Short-Range': 2}
infilling_python
Image_Filtering
312
312
['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...
['heart_rate_cheek = (freq_max_cheek) * 60']
['heart_rate_forehead = (freq_max_forehead) * 60', '', 'print(f"Heart Rate (Cheek): {heart_rate_cheek:.2f} beats per minute")', 'print(f"Heart Rate (Forehead): {heart_rate_forehead:.2f} beats per minute")']
[]
Variable 'freq_max_cheek' used at line 312 is defined at line 309 and has a Short-Range dependency.
{}
{'Variable Short-Range': 1}
infilling_python
Image_Filtering
313
313
['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...
['heart_rate_forehead = (freq_max_forehead) * 60']
['', 'print(f"Heart Rate (Cheek): {heart_rate_cheek:.2f} beats per minute")', 'print(f"Heart Rate (Forehead): {heart_rate_forehead:.2f} beats per minute")']
[]
Variable 'freq_max_forehead' used at line 313 is defined at line 310 and has a Short-Range dependency.
{}
{'Variable Short-Range': 1}
infilling_python
Credit_Scoring_Fairness
23
24
['import os', 'import pandas as pd', 'import numpy as np', 'import matplotlib.pyplot as plt', 'import matplotlib.cm as cm', 'from sklearn.model_selection import train_test_split', 'from sklearn.naive_bayes import GaussianNB', 'from sklearn.metrics import confusion_matrix', 'from sklearn.ensemble import RandomForestClas...
['bank = pd.read_csv(BANK_PATH)', 'df = pd.DataFrame(bank)']
['df = df.sample(n=500, random_state=1234).reset_index(drop=True)', "dummy = df[['catAge', 'job', 'marital','education','balance','day', 'month', 'duration', 'campaign', 'pdays', 'previous', 'Fmonth', 'biDefault', 'biHousing', 'biLoan']]", 'dummy = pd.get_dummies(data=dummy)', '', '', '# Machine Learning Classificatio...
[]
Library 'pd' used at line 23 is imported at line 2 and has a Medium-Range dependency. Variable 'BANK_PATH' used at line 23 is defined at line 20 and has a Short-Range dependency. Library 'pd' used at line 24 is imported at line 2 and has a Medium-Range dependency. Variable 'bank' used at line 24 is defined at line 23 a...
{}
{'Library Medium-Range': 2, 'Variable Short-Range': 2}
infilling_python
Credit_Scoring_Fairness
50
51
['import os', 'import pandas as pd', 'import numpy as np', 'import matplotlib.pyplot as plt', 'import matplotlib.cm as cm', 'from sklearn.model_selection import train_test_split', 'from sklearn.naive_bayes import GaussianNB', 'from sklearn.metrics import confusion_matrix', 'from sklearn.ensemble import RandomForestClas...
['gnb = GaussianNB()', 'gnb_pred = gnb.fit(x_train, y_train).predict(x_test)']
['', '# Result', 'test_df = x_test.copy()', "test_df['biY'] = y_test", "test_df['pred'] = pd.Series(gnb_pred, index=test_df.index)", "test_df['accurate'] = (test_df['pred'] == test_df['biY'])", '', '', '# Confusion Matrix', "confusion_mat = confusion_matrix(test_df['biY'], test_df['pred'])", "print('confusion_matrix: '...
[]
Library 'GaussianNB' used at line 50 is imported at line 7 and has a Long-Range dependency. Variable 'gnb' used at line 51 is defined at line 50 and has a Short-Range dependency. Variable 'x_train' used at line 51 is defined at line 39 and has a Medium-Range dependency. Variable 'y_train' used at line 51 is defined at ...
{}
{'Library Long-Range': 1, 'Variable Short-Range': 1, 'Variable Medium-Range': 3}
infilling_python
Credit_Scoring_Fairness
51
51
['import os', 'import pandas as pd', 'import numpy as np', 'import matplotlib.pyplot as plt', 'import matplotlib.cm as cm', 'from sklearn.model_selection import train_test_split', 'from sklearn.naive_bayes import GaussianNB', 'from sklearn.metrics import confusion_matrix', 'from sklearn.ensemble import RandomForestClas...
['gnb_pred = gnb.fit(x_train, y_train).predict(x_test)']
['', '# Result', 'test_df = x_test.copy()', "test_df['biY'] = y_test", "test_df['pred'] = pd.Series(gnb_pred, index=test_df.index)", "test_df['accurate'] = (test_df['pred'] == test_df['biY'])", '', '', '# Confusion Matrix', "confusion_mat = confusion_matrix(test_df['biY'], test_df['pred'])", "print('confusion_matrix: '...
[]
Variable 'gnb' used at line 51 is defined at line 50 and has a Short-Range dependency. Variable 'x_train' used at line 51 is defined at line 39 and has a Medium-Range dependency. Variable 'y_train' used at line 51 is defined at line 39 and has a Medium-Range dependency. Variable 'x_test' used at line 51 is defined at l...
{}
{'Variable Short-Range': 1, 'Variable Medium-Range': 3}
infilling_python
Credit_Scoring_Fairness
56
56
['import os', 'import pandas as pd', 'import numpy as np', 'import matplotlib.pyplot as plt', 'import matplotlib.cm as cm', 'from sklearn.model_selection import train_test_split', 'from sklearn.naive_bayes import GaussianNB', 'from sklearn.metrics import confusion_matrix', 'from sklearn.ensemble import RandomForestClas...
["test_df['pred'] = pd.Series(gnb_pred, index=test_df.index)"]
["test_df['accurate'] = (test_df['pred'] == test_df['biY'])", '', '', '# Confusion Matrix', "confusion_mat = confusion_matrix(test_df['biY'], test_df['pred'])", "print('confusion_matrix: ', confusion_mat)", '# Calculate Accuracy', 'accuracy_naive_bayes = (confusion_mat[0][0] + confusion_mat[1][1]) / (confusion_mat[0][0...
[]
Variable 'test_df' used at line 56 is defined at line 55 and has a Short-Range dependency. Library 'pd' used at line 56 is imported at line 2 and has a Long-Range dependency. Variable 'gnb_pred' used at line 56 is defined at line 51 and has a Short-Range dependency.
{}
{'Variable Short-Range': 2, 'Library Long-Range': 1}
infilling_python
Credit_Scoring_Fairness
61
61
['import os', 'import pandas as pd', 'import numpy as np', 'import matplotlib.pyplot as plt', 'import matplotlib.cm as cm', 'from sklearn.model_selection import train_test_split', 'from sklearn.naive_bayes import GaussianNB', 'from sklearn.metrics import confusion_matrix', 'from sklearn.ensemble import RandomForestClas...
["confusion_mat = confusion_matrix(test_df['biY'], test_df['pred'])"]
["print('confusion_matrix: ', confusion_mat)", '# Calculate Accuracy', 'accuracy_naive_bayes = (confusion_mat[0][0] + confusion_mat[1][1]) / (confusion_mat[0][0] + confusion_mat[0][1] + confusion_mat[1][0] + confusion_mat[1][1])', "print('accuracy_naive_bayes: ', accuracy_naive_bayes)", '', '# Split dataset based on ma...
[]
Library 'confusion_matrix' used at line 61 is imported at line 8 and has a Long-Range dependency. Variable 'test_df' used at line 61 is defined at line 57 and has a Short-Range dependency.
{}
{'Library Long-Range': 1, 'Variable Short-Range': 1}
infilling_python
Credit_Scoring_Fairness
64
64
['import os', 'import pandas as pd', 'import numpy as np', 'import matplotlib.pyplot as plt', 'import matplotlib.cm as cm', 'from sklearn.model_selection import train_test_split', 'from sklearn.naive_bayes import GaussianNB', 'from sklearn.metrics import confusion_matrix', 'from sklearn.ensemble import RandomForestClas...
['accuracy_naive_bayes = (confusion_mat[0][0] + confusion_mat[1][1]) / (confusion_mat[0][0] + confusion_mat[0][1] + confusion_mat[1][0] + confusion_mat[1][1])']
["print('accuracy_naive_bayes: ', accuracy_naive_bayes)", '', '# Split dataset based on marital status', '', "test_married = x_test[x_test['marital_married'] == 1]", "test_single = x_test[x_test['marital_single'] == 1]", "test_divorced = x_test[x_test['marital_divorced'] == 1]", '', '# Test on single subset with Naive ...
[]
Variable 'confusion_mat' used at line 64 is defined at line 61 and has a Short-Range dependency.
{}
{'Variable Short-Range': 1}
infilling_python
Credit_Scoring_Fairness
74
74
['import os', 'import pandas as pd', 'import numpy as np', 'import matplotlib.pyplot as plt', 'import matplotlib.cm as cm', 'from sklearn.model_selection import train_test_split', 'from sklearn.naive_bayes import GaussianNB', 'from sklearn.metrics import confusion_matrix', 'from sklearn.ensemble import RandomForestClas...
['gnb_pred_single = gnb.fit(x_train, y_train).predict(test_single)']
['test_df = test_single.copy()', "test_df['biY'] = y_test", "test_df['pred'] = pd.Series(gnb_pred_single, index=test_df.index)", "test_df['accurate'] = (test_df['pred'] == test_df['biY'])", "confusion_matrix_single = confusion_matrix(test_df['biY'], test_df['pred'])", "print('confusion_matrix_single: ', confusion_matri...
[]
Variable 'gnb' used at line 74 is defined at line 50 and has a Medium-Range dependency. Variable 'x_train' used at line 74 is defined at line 39 and has a Long-Range dependency. Variable 'y_train' used at line 74 is defined at line 39 and has a Long-Range dependency. Variable 'test_single' used at line 74 is defined at...
{}
{'Variable Medium-Range': 1, 'Variable Long-Range': 2, 'Variable Short-Range': 1}
infilling_python
Credit_Scoring_Fairness
77
77
['import os', 'import pandas as pd', 'import numpy as np', 'import matplotlib.pyplot as plt', 'import matplotlib.cm as cm', 'from sklearn.model_selection import train_test_split', 'from sklearn.naive_bayes import GaussianNB', 'from sklearn.metrics import confusion_matrix', 'from sklearn.ensemble import RandomForestClas...
["test_df['pred'] = pd.Series(gnb_pred_single, index=test_df.index)"]
["test_df['accurate'] = (test_df['pred'] == test_df['biY'])", "confusion_matrix_single = confusion_matrix(test_df['biY'], test_df['pred'])", "print('confusion_matrix_single: ', confusion_matrix_single)", 'accuracy_naive_bayes_single = (confusion_matrix_single[0][0] + confusion_matrix_single[1][1]) / (confusion_matrix_s...
[]
Variable 'test_df' used at line 77 is defined at line 76 and has a Short-Range dependency. Library 'pd' used at line 77 is imported at line 2 and has a Long-Range dependency. Variable 'gnb_pred_single' used at line 77 is defined at line 74 and has a Short-Range dependency.
{}
{'Variable Short-Range': 2, 'Library Long-Range': 1}
infilling_python
Credit_Scoring_Fairness
79
79
['import os', 'import pandas as pd', 'import numpy as np', 'import matplotlib.pyplot as plt', 'import matplotlib.cm as cm', 'from sklearn.model_selection import train_test_split', 'from sklearn.naive_bayes import GaussianNB', 'from sklearn.metrics import confusion_matrix', 'from sklearn.ensemble import RandomForestClas...
["confusion_matrix_single = confusion_matrix(test_df['biY'], test_df['pred'])"]
["print('confusion_matrix_single: ', confusion_matrix_single)", 'accuracy_naive_bayes_single = (confusion_matrix_single[0][0] + confusion_matrix_single[1][1]) / (confusion_matrix_single[0][0] + confusion_matrix_single[0][1] + confusion_matrix_single[1][0] + confusion_matrix_single[1][1])', "print('accuracy_naive_bayes_...
[]
Library 'confusion_matrix' used at line 79 is imported at line 8 and has a Long-Range dependency. Variable 'test_df' used at line 79 is defined at line 78 and has a Short-Range dependency.
{}
{'Library Long-Range': 1, 'Variable Short-Range': 1}
infilling_python
Credit_Scoring_Fairness
81
81
['import os', 'import pandas as pd', 'import numpy as np', 'import matplotlib.pyplot as plt', 'import matplotlib.cm as cm', 'from sklearn.model_selection import train_test_split', 'from sklearn.naive_bayes import GaussianNB', 'from sklearn.metrics import confusion_matrix', 'from sklearn.ensemble import RandomForestClas...
['accuracy_naive_bayes_single = (confusion_matrix_single[0][0] + confusion_matrix_single[1][1]) / (confusion_matrix_single[0][0] + confusion_matrix_single[0][1] + confusion_matrix_single[1][0] + confusion_matrix_single[1][1])']
["print('accuracy_naive_bayes_single: ', accuracy_naive_bayes_single)", '', '# Test on married subset with Naive Bayes Model', 'gnb_pred_married = gnb.fit(x_train, y_train).predict(test_married)', 'test_df = test_married.copy()', "test_df['biY'] = y_test", "test_df['pred'] = pd.Series(gnb_pred_married, index=test_df.in...
[]
Variable 'confusion_matrix_single' used at line 81 is defined at line 79 and has a Short-Range dependency.
{}
{'Variable Short-Range': 1}
infilling_python
Credit_Scoring_Fairness
85
90
['import os', 'import pandas as pd', 'import numpy as np', 'import matplotlib.pyplot as plt', 'import matplotlib.cm as cm', 'from sklearn.model_selection import train_test_split', 'from sklearn.naive_bayes import GaussianNB', 'from sklearn.metrics import confusion_matrix', 'from sklearn.ensemble import RandomForestClas...
['gnb_pred_married = gnb.fit(x_train, y_train).predict(test_married)', 'test_df = test_married.copy()', "test_df['biY'] = y_test", "test_df['pred'] = pd.Series(gnb_pred_married, index=test_df.index)", "test_df['accurate'] = (test_df['pred'] == test_df['biY'])", "confusion_matrix_married = confusion_matrix(test_df['biY'...
["print('confusion_matrix_married: ', confusion_matrix_married)", 'accuracy_naive_bayes_married = (confusion_matrix_married[0][0] + confusion_matrix_married[1][1]) / (confusion_matrix_married[0][0] + confusion_matrix_married[0][1] + confusion_matrix_married[1][0] + confusion_matrix_married[1][1])', "print('accuracy_nai...
[]
Variable 'gnb' used at line 85 is defined at line 50 and has a Long-Range dependency. Variable 'x_train' used at line 85 is defined at line 39 and has a Long-Range dependency. Variable 'y_train' used at line 85 is defined at line 39 and has a Long-Range dependency. Variable 'test_married' used at line 85 is defined at ...
{}
{'Variable Long-Range': 4, 'Variable Medium-Range': 2, 'Variable Short-Range': 6, 'Library Long-Range': 2}
infilling_python
Credit_Scoring_Fairness
92
92
['import os', 'import pandas as pd', 'import numpy as np', 'import matplotlib.pyplot as plt', 'import matplotlib.cm as cm', 'from sklearn.model_selection import train_test_split', 'from sklearn.naive_bayes import GaussianNB', 'from sklearn.metrics import confusion_matrix', 'from sklearn.ensemble import RandomForestClas...
['accuracy_naive_bayes_married = (confusion_matrix_married[0][0] + confusion_matrix_married[1][1]) / (confusion_matrix_married[0][0] + confusion_matrix_married[0][1] + confusion_matrix_married[1][0] + confusion_matrix_married[1][1])']
["print('accuracy_naive_bayes_married: ', accuracy_naive_bayes_married)", '', '# Test on divorced subset with Naive Bayes Model', 'gnb_pred_divorced = gnb.fit(x_train, y_train).predict(test_divorced)', 'test_df = test_divorced.copy()', "test_df['biY'] = y_test", "test_df['pred'] = pd.Series(gnb_pred_divorced, index=tes...
[]
Variable 'confusion_matrix_married' used at line 92 is defined at line 90 and has a Short-Range dependency.
{}
{'Variable Short-Range': 1}
infilling_python
Credit_Scoring_Fairness
96
101
['import os', 'import pandas as pd', 'import numpy as np', 'import matplotlib.pyplot as plt', 'import matplotlib.cm as cm', 'from sklearn.model_selection import train_test_split', 'from sklearn.naive_bayes import GaussianNB', 'from sklearn.metrics import confusion_matrix', 'from sklearn.ensemble import RandomForestClas...
['gnb_pred_divorced = gnb.fit(x_train, y_train).predict(test_divorced)', 'test_df = test_divorced.copy()', "test_df['biY'] = y_test", "test_df['pred'] = pd.Series(gnb_pred_divorced, index=test_df.index)", "test_df['accurate'] = (test_df['pred'] == test_df['biY'])", "confusion_matrix_divorced = confusion_matrix(test_df[...
["print('confusion_matrix_divorced: ', confusion_matrix_divorced)", 'accuracy_naive_bayes_divorced = (confusion_matrix_divorced[0][0] + confusion_matrix_divorced[1][1]) / (confusion_matrix_divorced[0][0] + confusion_matrix_divorced[0][1] + confusion_matrix_divorced[1][0] + confusion_matrix_divorced[1][1])', "print('acc...
[]
Variable 'gnb' used at line 96 is defined at line 50 and has a Long-Range dependency. Variable 'x_train' used at line 96 is defined at line 39 and has a Long-Range dependency. Variable 'y_train' used at line 96 is defined at line 39 and has a Long-Range dependency. Variable 'test_divorced' used at line 96 is defined at...
{}
{'Variable Long-Range': 4, 'Variable Medium-Range': 2, 'Variable Short-Range': 6, 'Library Long-Range': 2}
infilling_python
Credit_Scoring_Fairness
103
103
['import os', 'import pandas as pd', 'import numpy as np', 'import matplotlib.pyplot as plt', 'import matplotlib.cm as cm', 'from sklearn.model_selection import train_test_split', 'from sklearn.naive_bayes import GaussianNB', 'from sklearn.metrics import confusion_matrix', 'from sklearn.ensemble import RandomForestClas...
['accuracy_naive_bayes_divorced = (confusion_matrix_divorced[0][0] + confusion_matrix_divorced[1][1]) / (confusion_matrix_divorced[0][0] + confusion_matrix_divorced[0][1] + confusion_matrix_divorced[1][0] + confusion_matrix_divorced[1][1])']
["print('accuracy_naive_bayes_divorced: ', accuracy_naive_bayes_divorced)", '', '# Demographic Parity', '# positive rate = TP + TN', 'PR_Naive_Bayes_married = confusion_matrix_married[0,0] +confusion_matrix_married[1,1]', "print('PR_Naive_Bayes_married: ', PR_Naive_Bayes_married)", 'PR_Naive_Bayes_single = confusion_ma...
[]
Variable 'confusion_matrix_divorced' used at line 103 is defined at line 101 and has a Short-Range dependency.
{}
{'Variable Short-Range': 1}
infilling_python
Credit_Scoring_Fairness
108
108
['import os', 'import pandas as pd', 'import numpy as np', 'import matplotlib.pyplot as plt', 'import matplotlib.cm as cm', 'from sklearn.model_selection import train_test_split', 'from sklearn.naive_bayes import GaussianNB', 'from sklearn.metrics import confusion_matrix', 'from sklearn.ensemble import RandomForestClas...
['PR_Naive_Bayes_married = confusion_matrix_married[0,0] +confusion_matrix_married[1,1]']
["print('PR_Naive_Bayes_married: ', PR_Naive_Bayes_married)", 'PR_Naive_Bayes_single = confusion_matrix_single[0,0] +confusion_matrix_single[1,1]', "print('PR_Naive_Bayes_single: ',PR_Naive_Bayes_single)", 'PR_Naive_Bayes_divorced = confusion_matrix_divorced[0,0] +confusion_matrix_divorced[1,1]', "print('PR_Naive_Bayes...
[]
Variable 'confusion_matrix_married' used at line 108 is defined at line 90 and has a Medium-Range dependency.
{}
{'Variable Medium-Range': 1}
infilling_python
Credit_Scoring_Fairness
110
110
['import os', 'import pandas as pd', 'import numpy as np', 'import matplotlib.pyplot as plt', 'import matplotlib.cm as cm', 'from sklearn.model_selection import train_test_split', 'from sklearn.naive_bayes import GaussianNB', 'from sklearn.metrics import confusion_matrix', 'from sklearn.ensemble import RandomForestClas...
['PR_Naive_Bayes_single = confusion_matrix_single[0,0] +confusion_matrix_single[1,1]']
["print('PR_Naive_Bayes_single: ',PR_Naive_Bayes_single)", 'PR_Naive_Bayes_divorced = confusion_matrix_divorced[0,0] +confusion_matrix_divorced[1,1]', "print('PR_Naive_Bayes_divorced: ', PR_Naive_Bayes_divorced)", '', '# Equalized Opportunity', '# TPR = TP/TP+FN', 'TPR_Naive_Bayes_married = confusion_matrix_married[0,0...
[]
Variable 'confusion_matrix_single' used at line 110 is defined at line 79 and has a Long-Range dependency.
{}
{'Variable Long-Range': 1}
infilling_python
Credit_Scoring_Fairness
112
112
['import os', 'import pandas as pd', 'import numpy as np', 'import matplotlib.pyplot as plt', 'import matplotlib.cm as cm', 'from sklearn.model_selection import train_test_split', 'from sklearn.naive_bayes import GaussianNB', 'from sklearn.metrics import confusion_matrix', 'from sklearn.ensemble import RandomForestClas...
['PR_Naive_Bayes_divorced = confusion_matrix_divorced[0,0] +confusion_matrix_divorced[1,1]']
["print('PR_Naive_Bayes_divorced: ', PR_Naive_Bayes_divorced)", '', '# Equalized Opportunity', '# TPR = TP/TP+FN', 'TPR_Naive_Bayes_married = confusion_matrix_married[0,0] / (confusion_matrix_married[0,0] + confusion_matrix_married[1,0])', "print('TPR_Naive_Bayes_married: ', TPR_Naive_Bayes_married)", 'TPR_Naive_Bayes_...
[]
Variable 'confusion_matrix_divorced' used at line 112 is defined at line 101 and has a Medium-Range dependency.
{}
{'Variable Medium-Range': 1}
infilling_python
Credit_Scoring_Fairness
117
117
['import os', 'import pandas as pd', 'import numpy as np', 'import matplotlib.pyplot as plt', 'import matplotlib.cm as cm', 'from sklearn.model_selection import train_test_split', 'from sklearn.naive_bayes import GaussianNB', 'from sklearn.metrics import confusion_matrix', 'from sklearn.ensemble import RandomForestClas...
['TPR_Naive_Bayes_married = confusion_matrix_married[0,0] / (confusion_matrix_married[0,0] + confusion_matrix_married[1,0])']
["print('TPR_Naive_Bayes_married: ', TPR_Naive_Bayes_married)", 'TPR_Naive_Bayes_single = confusion_matrix_single[0,0] / (confusion_matrix_single[0,0] + confusion_matrix_single[1,0])', "print('TPR_Naive_Bayes_single: ', TPR_Naive_Bayes_single)", 'TPR_Naive_Bayes_divorced = confusion_matrix_divorced[0,0] / (confusion_ma...
[]
Variable 'confusion_matrix_married' used at line 117 is defined at line 90 and has a Medium-Range dependency.
{}
{'Variable Medium-Range': 1}
infilling_python
Credit_Scoring_Fairness
119
119
['import os', 'import pandas as pd', 'import numpy as np', 'import matplotlib.pyplot as plt', 'import matplotlib.cm as cm', 'from sklearn.model_selection import train_test_split', 'from sklearn.naive_bayes import GaussianNB', 'from sklearn.metrics import confusion_matrix', 'from sklearn.ensemble import RandomForestClas...
['TPR_Naive_Bayes_single = confusion_matrix_single[0,0] / (confusion_matrix_single[0,0] + confusion_matrix_single[1,0])']
["print('TPR_Naive_Bayes_single: ', TPR_Naive_Bayes_single)", 'TPR_Naive_Bayes_divorced = confusion_matrix_divorced[0,0] / (confusion_matrix_divorced[0,0] + confusion_matrix_divorced[1,0])', "print('TPR_Naive_Bayes_divorced: ', TPR_Naive_Bayes_divorced)", '', '# Equalized Odds', '# TPR = TP/TP+FN', '# FNR = FN/FN+TP', ...
[]
Variable 'confusion_matrix_single' used at line 119 is defined at line 79 and has a Long-Range dependency.
{}
{'Variable Long-Range': 1}
infilling_python
Credit_Scoring_Fairness
127
127
['import os', 'import pandas as pd', 'import numpy as np', 'import matplotlib.pyplot as plt', 'import matplotlib.cm as cm', 'from sklearn.model_selection import train_test_split', 'from sklearn.naive_bayes import GaussianNB', 'from sklearn.metrics import confusion_matrix', 'from sklearn.ensemble import RandomForestClas...
['FNR_Naive_Bayes_married = confusion_matrix_married[1,0] / (confusion_matrix_married[1,0] + confusion_matrix_married[0,0])']
["print('FNR_Naive_Bayes_married: ', FNR_Naive_Bayes_married)", 'FNR_Naive_Bayes_single = confusion_matrix_single[1,0] / (confusion_matrix_single[1,0] + confusion_matrix_single[0,0])', "print('FNR_Naive_Bayes_single: ', FNR_Naive_Bayes_single)", 'FNR_Naive_Bayes_divorced = confusion_matrix_divorced[1,0] / (confusion_ma...
[]
Variable 'confusion_matrix_married' used at line 127 is defined at line 90 and has a Long-Range dependency.
{}
{'Variable Long-Range': 1}
infilling_python
Credit_Scoring_Fairness
129
129
['import os', 'import pandas as pd', 'import numpy as np', 'import matplotlib.pyplot as plt', 'import matplotlib.cm as cm', 'from sklearn.model_selection import train_test_split', 'from sklearn.naive_bayes import GaussianNB', 'from sklearn.metrics import confusion_matrix', 'from sklearn.ensemble import RandomForestClas...
['FNR_Naive_Bayes_single = confusion_matrix_single[1,0] / (confusion_matrix_single[1,0] + confusion_matrix_single[0,0])']
["print('FNR_Naive_Bayes_single: ', FNR_Naive_Bayes_single)", 'FNR_Naive_Bayes_divorced = confusion_matrix_divorced[1,0] / (confusion_matrix_divorced[1,0] + confusion_matrix_divorced[0,0])', "print('FNR_Naive_Bayes_divorced: ', FNR_Naive_Bayes_divorced)", '', '# Fairness Through Unwareness', 'x_train_unawareness = x_tr...
[]
Variable 'confusion_matrix_single' used at line 129 is defined at line 79 and has a Long-Range dependency.
{}
{'Variable Long-Range': 1}
infilling_python
Credit_Scoring_Fairness
131
131
['import os', 'import pandas as pd', 'import numpy as np', 'import matplotlib.pyplot as plt', 'import matplotlib.cm as cm', 'from sklearn.model_selection import train_test_split', 'from sklearn.naive_bayes import GaussianNB', 'from sklearn.metrics import confusion_matrix', 'from sklearn.ensemble import RandomForestClas...
['FNR_Naive_Bayes_divorced = confusion_matrix_divorced[1,0] / (confusion_matrix_divorced[1,0] + confusion_matrix_divorced[0,0])']
["print('FNR_Naive_Bayes_divorced: ', FNR_Naive_Bayes_divorced)", '', '# Fairness Through Unwareness', 'x_train_unawareness = x_train.copy()', "x_train_unawareness.drop('marital_married', inplace=True, axis=1)", "x_train_unawareness.drop('marital_single', inplace=True, axis=1)", "x_train_unawareness.drop('marital_divor...
[]
Variable 'confusion_matrix_divorced' used at line 131 is defined at line 101 and has a Medium-Range dependency.
{}
{'Variable Medium-Range': 1}
infilling_python
Credit_Scoring_Fairness
150
152
['import os', 'import pandas as pd', 'import numpy as np', 'import matplotlib.pyplot as plt', 'import matplotlib.cm as cm', 'from sklearn.model_selection import train_test_split', 'from sklearn.naive_bayes import GaussianNB', 'from sklearn.metrics import confusion_matrix', 'from sklearn.ensemble import RandomForestClas...
["x_test_single.drop('marital_married', inplace=True, axis=1)", "x_test_single.drop('marital_single', inplace=True, axis=1)", "x_test_single.drop('marital_divorced', inplace=True, axis=1)"]
['# Drop the marital status columns for x_test_divorced', "x_test_divorced.drop('marital_married', inplace=True, axis=1)", "x_test_divorced.drop('marital_single', inplace=True, axis=1)", "x_test_divorced.drop('marital_divorced', inplace=True, axis=1)", '', '# Test on single set with Naive Bayes Model', 'gnb_pred_single...
[]
Variable 'x_test_single' used at line 150 is defined at line 143 and has a Short-Range dependency. Variable 'x_test_single' used at line 151 is defined at line 150 and has a Short-Range dependency. Variable 'x_test_single' used at line 152 is defined at line 151 and has a Short-Range dependency.
{}
{'Variable Short-Range': 3}
infilling_python
Credit_Scoring_Fairness
154
156
['import os', 'import pandas as pd', 'import numpy as np', 'import matplotlib.pyplot as plt', 'import matplotlib.cm as cm', 'from sklearn.model_selection import train_test_split', 'from sklearn.naive_bayes import GaussianNB', 'from sklearn.metrics import confusion_matrix', 'from sklearn.ensemble import RandomForestClas...
["x_test_divorced.drop('marital_married', inplace=True, axis=1)", "x_test_divorced.drop('marital_single', inplace=True, axis=1)", "x_test_divorced.drop('marital_divorced', inplace=True, axis=1)"]
['', '# Test on single set with Naive Bayes Model', 'gnb_pred_single = gnb.fit(x_train_unawareness, y_train).predict(x_test_single)', 'test_df = x_test_single.copy()', "test_df['biY'] = y_test", "test_df['pred'] = pd.Series(gnb_pred_single, index=test_df.index)", "test_df['accurate'] = (test_df['pred'] == test_df['biY'...
[]
Variable 'x_test_divorced' used at line 154 is defined at line 144 and has a Short-Range dependency. Variable 'x_test_divorced' used at line 155 is defined at line 154 and has a Short-Range dependency. Variable 'x_test_divorced' used at line 156 is defined at line 155 and has a Short-Range dependency.
{}
{'Variable Short-Range': 3}
infilling_python
Credit_Scoring_Fairness
159
165
['import os', 'import pandas as pd', 'import numpy as np', 'import matplotlib.pyplot as plt', 'import matplotlib.cm as cm', 'from sklearn.model_selection import train_test_split', 'from sklearn.naive_bayes import GaussianNB', 'from sklearn.metrics import confusion_matrix', 'from sklearn.ensemble import RandomForestClas...
['gnb_pred_single = gnb.fit(x_train_unawareness, y_train).predict(x_test_single)', 'test_df = x_test_single.copy()', "test_df['biY'] = y_test", "test_df['pred'] = pd.Series(gnb_pred_single, index=test_df.index)", "test_df['accurate'] = (test_df['pred'] == test_df['biY'])", '', "confusion_matrix_single = confusion_matri...
["print('confusion_matrix_single: ', confusion_matrix_single)", 'accuracy_naive_bayes_single = (confusion_matrix_single[0][0] + confusion_matrix_single[1][1]) / (confusion_matrix_single[0][0] + confusion_matrix_single[0][1] + confusion_matrix_single[1][0] + confusion_matrix_single[1][1])', "print('accuracy_naive_bayes_...
[]
Variable 'gnb' used at line 159 is defined at line 50 and has a Long-Range dependency. Variable 'x_train_unawareness' used at line 159 is defined at line 135 and has a Medium-Range dependency. Variable 'y_train' used at line 159 is defined at line 39 and has a Long-Range dependency. Variable 'x_test_single' used at lin...
{}
{'Variable Long-Range': 3, 'Variable Medium-Range': 1, 'Variable Short-Range': 7, 'Library Long-Range': 2}
infilling_python
Credit_Scoring_Fairness
171
176
['import os', 'import pandas as pd', 'import numpy as np', 'import matplotlib.pyplot as plt', 'import matplotlib.cm as cm', 'from sklearn.model_selection import train_test_split', 'from sklearn.naive_bayes import GaussianNB', 'from sklearn.metrics import confusion_matrix', 'from sklearn.ensemble import RandomForestClas...
['gnb_pred_married = gnb.fit(x_train_unawareness, y_train).predict(x_test_married)', 'test_df = x_test_married.copy()', "test_df['biY'] = y_test", "test_df['pred'] = pd.Series(gnb_pred_married, index=test_df.index)", "test_df['accurate'] = (test_df['pred'] == test_df['biY'])", "confusion_matrix_married = confusion_matr...
["print('confusion_matrix_married: ', confusion_matrix_married)", 'accuracy_naive_bayes_married = (confusion_matrix_married[0][0] + confusion_matrix_married[1][1]) / (confusion_matrix_married[0][0] + confusion_matrix_married[0][1] + confusion_matrix_married[1][0] + confusion_matrix_married[1][1])', "print('accuracy_nai...
[]
Variable 'gnb' used at line 171 is defined at line 50 and has a Long-Range dependency. Variable 'x_train_unawareness' used at line 171 is defined at line 138 and has a Long-Range dependency. Variable 'y_train' used at line 171 is defined at line 39 and has a Long-Range dependency. Variable 'x_test_married' used at line...
{}
{'Variable Long-Range': 4, 'Variable Medium-Range': 2, 'Variable Short-Range': 5, 'Library Long-Range': 2}
infilling_python
Credit_Scoring_Fairness
178
178
['import os', 'import pandas as pd', 'import numpy as np', 'import matplotlib.pyplot as plt', 'import matplotlib.cm as cm', 'from sklearn.model_selection import train_test_split', 'from sklearn.naive_bayes import GaussianNB', 'from sklearn.metrics import confusion_matrix', 'from sklearn.ensemble import RandomForestClas...
['accuracy_naive_bayes_married = (confusion_matrix_married[0][0] + confusion_matrix_married[1][1]) / (confusion_matrix_married[0][0] + confusion_matrix_married[0][1] + confusion_matrix_married[1][0] + confusion_matrix_married[1][1])']
["print('accuracy_naive_bayes_married: ', accuracy_naive_bayes_married)", '', '# Test on divorced set with Naive Bayes Model', 'gnb_pred_divorced = gnb.fit(x_train_unawareness, y_train).predict(x_test_divorced)', 'test_df = x_test_divorced.copy()', "test_df['biY'] = y_test", "test_df['pred'] = pd.Series(gnb_pred_divorc...
[]
Variable 'confusion_matrix_married' used at line 178 is defined at line 176 and has a Short-Range dependency.
{}
{'Variable Short-Range': 1}
infilling_python
Credit_Scoring_Fairness
182
187
['import os', 'import pandas as pd', 'import numpy as np', 'import matplotlib.pyplot as plt', 'import matplotlib.cm as cm', 'from sklearn.model_selection import train_test_split', 'from sklearn.naive_bayes import GaussianNB', 'from sklearn.metrics import confusion_matrix', 'from sklearn.ensemble import RandomForestClas...
['gnb_pred_divorced = gnb.fit(x_train_unawareness, y_train).predict(x_test_divorced)', 'test_df = x_test_divorced.copy()', "test_df['biY'] = y_test", "test_df['pred'] = pd.Series(gnb_pred_divorced, index=test_df.index)", "test_df['accurate'] = (test_df['pred'] == test_df['biY'])", "confusion_matrix_divorced = confusion...
["print('confusion_matrix_divorced: ', confusion_matrix_divorced)", 'accuracy_naive_bayes_divorced = (confusion_matrix_divorced[0][0] + confusion_matrix_divorced[1][1]) / (confusion_matrix_divorced[0][0] + confusion_matrix_divorced[0][1] + confusion_matrix_divorced[1][0] + confusion_matrix_divorced[1][1])', "print('acc...
[]
Variable 'gnb' used at line 182 is defined at line 50 and has a Long-Range dependency. Variable 'x_train_unawareness' used at line 182 is defined at line 138 and has a Long-Range dependency. Variable 'y_train' used at line 182 is defined at line 39 and has a Long-Range dependency. Variable 'x_test_divorced' used at lin...
{}
{'Variable Long-Range': 4, 'Variable Medium-Range': 2, 'Variable Short-Range': 5, 'Library Long-Range': 2}
infilling_python
Credit_Scoring_Fairness
194
199
['import os', 'import pandas as pd', 'import numpy as np', 'import matplotlib.pyplot as plt', 'import matplotlib.cm as cm', 'from sklearn.model_selection import train_test_split', 'from sklearn.naive_bayes import GaussianNB', 'from sklearn.metrics import confusion_matrix', 'from sklearn.ensemble import RandomForestClas...
['rf_pred = rf.fit(x_train, y_train).predict(x_test)', 'test_df = x_test.copy()', "test_df['biY'] = y_test", "test_df['pred'] = pd.Series(rf_pred, index=test_df.index)", "test_df['accurate'] = (test_df['pred'] == test_df['biY'])", "confusion_mat = confusion_matrix(test_df['biY'], test_df['pred'])"]
["print('confusion_matrix: ', confusion_mat)", '# Accuracy', 'accuracy_rf = (confusion_mat[0][0] + confusion_mat[1][1]) / (confusion_mat[0][0] + confusion_mat[0][1] + confusion_mat[1][0] + confusion_mat[1][1])', "print('accuracy_rf: ', accuracy_rf)", '', '# Split dataset based on marital status', "test_married = x_test...
[]
Variable 'rf' used at line 194 is defined at line 193 and has a Short-Range dependency. Variable 'x_train' used at line 194 is defined at line 39 and has a Long-Range dependency. Variable 'y_train' used at line 194 is defined at line 39 and has a Long-Range dependency. Variable 'x_test' used at line 194 is defined at l...
{}
{'Variable Short-Range': 7, 'Variable Long-Range': 5, 'Library Long-Range': 2}
infilling_python
Credit_Scoring_Fairness
211
216
['import os', 'import pandas as pd', 'import numpy as np', 'import matplotlib.pyplot as plt', 'import matplotlib.cm as cm', 'from sklearn.model_selection import train_test_split', 'from sklearn.naive_bayes import GaussianNB', 'from sklearn.metrics import confusion_matrix', 'from sklearn.ensemble import RandomForestClas...
['rf_pred_single = rf.fit(x_train, y_train).predict(test_single)', 'test_df = test_single.copy()', "test_df['biY'] = y_test", "test_df['pred'] = pd.Series(rf_pred_single, index=test_df.index)", "test_df['accurate'] = (test_df['pred'] == test_df['biY'])", "confusion_matrix_single = confusion_matrix(test_df['biY'], test_...
["print('confusion_matrix_single: ', confusion_matrix_single)", 'accuracy_rf_single = (confusion_matrix_single[0][0] + confusion_matrix_single[1][1]) / (confusion_matrix_single[0][0] + confusion_matrix_single[0][1] + confusion_matrix_single[1][0] + confusion_matrix_single[1][1])', "print('accuracy_rf_single: ', accurac...
[]
Variable 'rf' used at line 211 is defined at line 193 and has a Medium-Range dependency. Variable 'test_single' used at line 211 is defined at line 207 and has a Short-Range dependency. Variable 'x_train' used at line 211 is defined at line 39 and has a Long-Range dependency. Variable 'y_train' used at line 211 is defi...
{}
{'Variable Medium-Range': 1, 'Variable Short-Range': 7, 'Variable Long-Range': 3, 'Library Long-Range': 2}
infilling_python
Credit_Scoring_Fairness
264
264
['import os', 'import pandas as pd', 'import numpy as np', 'import matplotlib.pyplot as plt', 'import matplotlib.cm as cm', 'from sklearn.model_selection import train_test_split', 'from sklearn.naive_bayes import GaussianNB', 'from sklearn.metrics import confusion_matrix', 'from sklearn.ensemble import RandomForestClas...
['FNR_rf_married = confusion_matrix_married[1,0] / (confusion_matrix_married[1,0] + confusion_matrix_married[0,0])']
["print('FNR_rf_married: ', FNR_rf_married)", 'FNR_rf_single = confusion_matrix_single[1,0] / (confusion_matrix_single[1,0] + confusion_matrix_single[0,0])', "print('FNR_rf_single: ', FNR_rf_single)", 'FNR_rf_divorced = confusion_matrix_divorced[1,0] / (confusion_matrix_divorced[1,0] + confusion_matrix_divorced[0,0])',...
[]
Variable 'confusion_matrix_married' used at line 264 is defined at line 227 and has a Long-Range dependency.
{}
{'Variable Long-Range': 1}
infilling_python
Credit_Scoring_Fairness
329
329
['import os', 'import pandas as pd', 'import numpy as np', 'import matplotlib.pyplot as plt', 'import matplotlib.cm as cm', 'from sklearn.model_selection import train_test_split', 'from sklearn.naive_bayes import GaussianNB', 'from sklearn.metrics import confusion_matrix', 'from sklearn.ensemble import RandomForestClas...
["svm = svm_model.SVC(class_weight='balanced') "]
['svm_pred = svm.fit(x_train, y_train).predict(x_test)', '', 'test_df = x_test.copy()', "test_df['biY'] = y_test", "test_df['pred'] = pd.Series(svm_pred, index=test_df.index)", "test_df['accurate'] = (test_df['pred'] == test_df['biY'])", "confusion_mat = confusion_matrix(test_df['biY'], test_df['pred'])", "print('confu...
[]
Library 'svm_model' used at line 329 is imported at line 10 and has a Long-Range dependency.
{}
{'Library Long-Range': 1}
infilling_python
Credit_Scoring_Fairness
330
336
['import os', 'import pandas as pd', 'import numpy as np', 'import matplotlib.pyplot as plt', 'import matplotlib.cm as cm', 'from sklearn.model_selection import train_test_split', 'from sklearn.naive_bayes import GaussianNB', 'from sklearn.metrics import confusion_matrix', 'from sklearn.ensemble import RandomForestClas...
['svm_pred = svm.fit(x_train, y_train).predict(x_test)', '', 'test_df = x_test.copy()', "test_df['biY'] = y_test", "test_df['pred'] = pd.Series(svm_pred, index=test_df.index)", "test_df['accurate'] = (test_df['pred'] == test_df['biY'])", "confusion_mat = confusion_matrix(test_df['biY'], test_df['pred'])"]
["print('confusion_matrix: ', confusion_mat)", '', '# Accuracy', 'accuracy_svm = (confusion_mat[0][0] + confusion_mat[1][1]) / (confusion_mat[0][0] + confusion_mat[0][1] + confusion_mat[1][0] + confusion_mat[1][1])', "print('accuracy_svm: ', accuracy_svm)", '', '# Split dataset based on marital status', '', "test_marri...
[]
Variable 'svm' used at line 330 is defined at line 329 and has a Short-Range dependency. Variable 'x_train' used at line 330 is defined at line 39 and has a Long-Range dependency. Variable 'y_train' used at line 330 is defined at line 39 and has a Long-Range dependency. Variable 'x_test' used at line 330 is defined at ...
{}
{'Variable Short-Range': 6, 'Variable Long-Range': 5, 'Library Long-Range': 2}
infilling_python
Credit_Scoring_Fairness
350
355
['import os', 'import pandas as pd', 'import numpy as np', 'import matplotlib.pyplot as plt', 'import matplotlib.cm as cm', 'from sklearn.model_selection import train_test_split', 'from sklearn.naive_bayes import GaussianNB', 'from sklearn.metrics import confusion_matrix', 'from sklearn.ensemble import RandomForestClas...
['svm_pred_single = svm.fit(x_train, y_train).predict(test_single)', 'test_df = test_single.copy()', "test_df['biY'] = y_test", "test_df['pred'] = pd.Series(svm_pred_single, index=test_df.index)", "test_df['accurate'] = (test_df['pred'] == test_df['biY'])", "confusion_matrix_single = confusion_matrix(test_df['biY'], te...
["print('confusion_matrix_single: ', confusion_matrix_single)", 'accuracy_svm_single = (confusion_matrix_single[0][0] + confusion_matrix_single[1][1]) / (confusion_matrix_single[0][0] + confusion_matrix_single[0][1] + confusion_matrix_single[1][0] + confusion_matrix_single[1][1])', "print('accuracy_svm_single: ', accur...
[]
Variable 'svm' used at line 350 is defined at line 329 and has a Medium-Range dependency. Variable 'test_single' used at line 350 is defined at line 346 and has a Short-Range dependency. Variable 'x_train' used at line 350 is defined at line 39 and has a Long-Range dependency. Variable 'y_train' used at line 350 is def...
{}
{'Variable Medium-Range': 1, 'Variable Short-Range': 7, 'Variable Long-Range': 3, 'Library Long-Range': 2}
infilling_python
Credit_Scoring_Fairness
459
464
['import os', 'import pandas as pd', 'import numpy as np', 'import matplotlib.pyplot as plt', 'import matplotlib.cm as cm', 'from sklearn.model_selection import train_test_split', 'from sklearn.naive_bayes import GaussianNB', 'from sklearn.metrics import confusion_matrix', 'from sklearn.ensemble import RandomForestClas...
['svm_pred_divorced = svm.fit(x_train_unawareness, y_train).predict(x_test_divorced)', 'test_df = x_test_divorced.copy()', "test_df['biY'] = y_test", "test_df['pred'] = pd.Series(svm_pred_divorced, index=test_df.index)", "test_df['accurate'] = (test_df['pred'] == test_df['biY'])", "confusion_matrix_divorced = confusion...
["print('confusion_matrix_divorced: ', confusion_matrix_divorced)", 'accuracy_svm_divorced = (confusion_matrix_divorced[0][0] + confusion_matrix_divorced[1][1]) / (confusion_matrix_divorced[0][0] + confusion_matrix_divorced[0][1] + confusion_matrix_divorced[1][0] + confusion_matrix_divorced[1][1])', "print('accuracy_sv...
[]
Variable 'svm' used at line 459 is defined at line 329 and has a Long-Range dependency. Variable 'x_train_unawareness' used at line 459 is defined at line 415 and has a Long-Range dependency. Variable 'y_train' used at line 459 is defined at line 39 and has a Long-Range dependency. Variable 'x_test_divorced' used at li...
{}
{'Variable Long-Range': 3, 'Variable Medium-Range': 2, 'Variable Short-Range': 5, 'Library Long-Range': 2}
infilling_python
Credit_Scoring_Fairness
470
472
['import os', 'import pandas as pd', 'import numpy as np', 'import matplotlib.pyplot as plt', 'import matplotlib.cm as cm', 'from sklearn.model_selection import train_test_split', 'from sklearn.naive_bayes import GaussianNB', 'from sklearn.metrics import confusion_matrix', 'from sklearn.ensemble import RandomForestClas...
['linear_regression_model = linear_model.LinearRegression()', 'linear_regression_model.fit(x_train, y_train)', 'prediction = linear_regression_model.predict(x_test)']
['# Result', 'test_df = x_test.copy()', "test_df['biY'] = y_test", "test_df['pred'] = pd.Series(prediction, index=test_df.index)", "test_df['accurate'] = (test_df['pred'] == test_df['biY'])", 'print("test_df[\'pred\']: ", test_df[\'pred\'])']
[]
Library 'linear_model' used at line 470 is imported at line 11 and has a Long-Range dependency. Variable 'linear_regression_model' used at line 471 is defined at line 470 and has a Short-Range dependency. Variable 'x_train' used at line 471 is defined at line 39 and has a Long-Range dependency. Variable 'y_train' used ...
{}
{'Library Long-Range': 1, 'Variable Short-Range': 2, 'Variable Long-Range': 3}
infilling_python
GAN_model
31
31
['import sys, os', 'from pathlib import Path', '# sys.path.append(os.path.dirname(os.path.abspath(__file__)))', '', 'import sys, os', 'import glob', '# import imageio', 'import matplotlib.pyplot as plt', 'import numpy as np', 'import os', 'import PIL', 'from tensorflow.keras import layers', 'import time', 'from tensorf...
[' return tf.keras.layers.LeakyReLU(.2)(x)']
['', 'def insnorm(x):', ' return tfa.layers.InstanceNormalization(axis=-1)(x)', '', 'def pixelnorm(x):', ' return x/tf.math.sqrt(tf.reduce_mean(x**2+(10e-8), axis = 3, keepdims=True))', '', 'def batchnorm(x):', ' return layers.BatchNormalization(axis=-1)(x)', '', '#minibatch standard deviation as dscribed in P...
[]
Library 'tf' used at line 31 is imported at line 16 and has a Medium-Range dependency. Variable 'x' used at line 31 is defined at line 30 and has a Short-Range dependency.
{}
{'Library Medium-Range': 1, 'Variable Short-Range': 1}
infilling_python
GAN_model
37
37
['import sys, os', 'from pathlib import Path', '# sys.path.append(os.path.dirname(os.path.abspath(__file__)))', '', 'import sys, os', 'import glob', '# import imageio', 'import matplotlib.pyplot as plt', 'import numpy as np', 'import os', 'import PIL', 'from tensorflow.keras import layers', 'import time', 'from tensorf...
[' return x/tf.math.sqrt(tf.reduce_mean(x**2+(10e-8), axis = 3, keepdims=True))']
['', 'def batchnorm(x):', ' return layers.BatchNormalization(axis=-1)(x)', '', '#minibatch standard deviation as dscribed in Progressive GAN Tero Karras et al. https://github.com/tkarras/progressive_growing_of_gans', 'def minibatch_stddev_layer(x, group_size=4):', ' # Minibatch must be divisible by (or smaller th...
[]
Variable 'x' used at line 37 is defined at line 36 and has a Short-Range dependency. Library 'tf' used at line 37 is imported at line 16 and has a Medium-Range dependency.
{}
{'Variable Short-Range': 1, 'Library Medium-Range': 1}
infilling_python
GAN_model
96
98
['import sys, os', 'from pathlib import Path', '# sys.path.append(os.path.dirname(os.path.abspath(__file__)))', '', 'import sys, os', 'import glob', '# import imageio', 'import matplotlib.pyplot as plt', 'import numpy as np', 'import os', 'import PIL', 'from tensorflow.keras import layers', 'import time', 'from tensorf...
[' self.kernel_size = kernel_size', ' self.strides = strides', ' self.kernel_initializer = kernel_initializer']
[' self.bias_initializer = bias_initializer', ' self.gain = gain', '', ' def build(self, input_shape):', ' *_, n_channels = input_shape', ' fan_in = self.kernel_size[0]*self.kernel_size[1]*n_channels', ' self.scale = tf.math.sqrt(self.gain/fan_in)', ' ', ' self.w = se...
[]
Variable 'self' used at line 96 is defined at line 85 and has a Medium-Range dependency. Variable 'kernel_size' used at line 96 is defined at line 87 and has a Short-Range dependency. Variable 'self' used at line 97 is defined at line 85 and has a Medium-Range dependency. Variable 'strides' used at line 97 is defined a...
{}
{'Variable Medium-Range': 3, 'Variable Short-Range': 3}
infilling_python
GAN_model
95
100
['import sys, os', 'from pathlib import Path', '# sys.path.append(os.path.dirname(os.path.abspath(__file__)))', '', 'import sys, os', 'import glob', '# import imageio', 'import matplotlib.pyplot as plt', 'import numpy as np', 'import os', 'import PIL', 'from tensorflow.keras import layers', 'import time', 'from tensorf...
[' self.filters = filters', ' self.kernel_size = kernel_size', ' self.strides = strides', ' self.kernel_initializer = kernel_initializer', ' self.bias_initializer = bias_initializer', ' self.gain = gain']
['', ' def build(self, input_shape):', ' *_, n_channels = input_shape', ' fan_in = self.kernel_size[0]*self.kernel_size[1]*n_channels', ' self.scale = tf.math.sqrt(self.gain/fan_in)', ' ', ' self.w = self.add_weight(', " name='kernel',", ' shape=(*self...
[]
Variable 'self' used at line 95 is defined at line 85 and has a Short-Range dependency. Variable 'filters' used at line 95 is defined at line 86 and has a Short-Range dependency. Variable 'self' used at line 96 is defined at line 85 and has a Medium-Range dependency. Variable 'kernel_size' used at line 96 is defined at...
{}
{'Variable Short-Range': 7, 'Variable Medium-Range': 5}
infilling_python
GAN_model
104
105
['import sys, os', 'from pathlib import Path', '# sys.path.append(os.path.dirname(os.path.abspath(__file__)))', '', 'import sys, os', 'import glob', '# import imageio', 'import matplotlib.pyplot as plt', 'import numpy as np', 'import os', 'import PIL', 'from tensorflow.keras import layers', 'import time', 'from tensorf...
[' fan_in = self.kernel_size[0]*self.kernel_size[1]*n_channels', ' self.scale = tf.math.sqrt(self.gain/fan_in)']
[' ', ' self.w = self.add_weight(', " name='kernel',", ' shape=(*self.kernel_size,', ' n_channels,', ' self.filters),', ' initializer=self.kernel_initializer,', ' trainable=True,', ' ...
[]
Variable 'self' used at line 104 is defined at line 102 and has a Short-Range dependency. Variable 'n_channels' used at line 104 is defined at line 103 and has a Short-Range dependency. Variable 'kernel_size' used at line 104 is defined at line 96 and has a Short-Range dependency. Variable 'self' used at line 105 is de...
{}
{'Variable Short-Range': 6, 'Library Long-Range': 1}
infilling_python
GAN_model
108
114
['import sys, os', 'from pathlib import Path', '# sys.path.append(os.path.dirname(os.path.abspath(__file__)))', '', 'import sys, os', 'import glob', '# import imageio', 'import matplotlib.pyplot as plt', 'import numpy as np', 'import os', 'import PIL', 'from tensorflow.keras import layers', 'import time', 'from tensorf...
[" name='kernel',", ' shape=(*self.kernel_size,', ' n_channels,', ' self.filters),', ' initializer=self.kernel_initializer,', ' trainable=True,', ' dtype=tf.float32)']
['', ' self.b = self.add_weight(', " name='bias',", ' shape=(self.filters,),', ' initializer=self.bias_initializer,', ' trainable=True,', ' dtype=tf.float32)', ' ', ' def get_config(self):', ' config = super().get_config(...
[]
Variable 'self' used at line 109 is defined at line 102 and has a Short-Range dependency. Variable 'kernel_size' used at line 109 is defined at line 96 and has a Medium-Range dependency. Variable 'n_channels' used at line 110 is defined at line 103 and has a Short-Range dependency. Variable 'self' used at line 111 is d...
{}
{'Variable Short-Range': 4, 'Variable Medium-Range': 3, 'Library Long-Range': 1}
infilling_python
GAN_model
117
121
['import sys, os', 'from pathlib import Path', '# sys.path.append(os.path.dirname(os.path.abspath(__file__)))', '', 'import sys, os', 'import glob', '# import imageio', 'import matplotlib.pyplot as plt', 'import numpy as np', 'import os', 'import PIL', 'from tensorflow.keras import layers', 'import time', 'from tensorf...
[" name='bias',", ' shape=(self.filters,),', ' initializer=self.bias_initializer,', ' trainable=True,', ' dtype=tf.float32)']
[' ', ' def get_config(self):', ' config = super().get_config()', ' config.update({', ' "filters": self.filters,', ' "kernel_size": self.kernel_size,', ' "strides": self.strides,', ' "kernel_initializer": self.kernel_initializer,', ' "bias_i...
[]
Variable 'self' used at line 118 is defined at line 102 and has a Medium-Range dependency. Variable 'filters' used at line 118 is defined at line 95 and has a Medium-Range dependency. Variable 'self' used at line 119 is defined at line 102 and has a Medium-Range dependency. Variable 'bias_initializer' used at line 119 ...
{}
{'Variable Medium-Range': 4, 'Library Long-Range': 1}
infilling_python
GAN_model
127
127
['import sys, os', 'from pathlib import Path', '# sys.path.append(os.path.dirname(os.path.abspath(__file__)))', '', 'import sys, os', 'import glob', '# import imageio', 'import matplotlib.pyplot as plt', 'import numpy as np', 'import os', 'import PIL', 'from tensorflow.keras import layers', 'import time', 'from tensorf...
[' "kernel_size": self.kernel_size,']
[' "strides": self.strides,', ' "kernel_initializer": self.kernel_initializer,', ' "bias_initializer": self.bias_initializer,', ' "gain": self.gain,', ' })', ' return config', ' ', ' def call(self, inputs, training=None):', " x = tf.nn.conv2d(inputs...
[]
Variable 'self' used at line 127 is defined at line 123 and has a Short-Range dependency. Variable 'kernel_size' used at line 127 is defined at line 96 and has a Long-Range dependency.
{}
{'Variable Short-Range': 1, 'Variable Long-Range': 1}
infilling_python
GAN_model
127
130
['import sys, os', 'from pathlib import Path', '# sys.path.append(os.path.dirname(os.path.abspath(__file__)))', '', 'import sys, os', 'import glob', '# import imageio', 'import matplotlib.pyplot as plt', 'import numpy as np', 'import os', 'import PIL', 'from tensorflow.keras import layers', 'import time', 'from tensorf...
[' "kernel_size": self.kernel_size,', ' "strides": self.strides,', ' "kernel_initializer": self.kernel_initializer,', ' "bias_initializer": self.bias_initializer,']
[' "gain": self.gain,', ' })', ' return config', ' ', ' def call(self, inputs, training=None):', " x = tf.nn.conv2d(inputs, filters=self.scale*self.w, strides=self.strides, padding = 'SAME')", '', ' x = x + self.b', '', ' return x', '', 'class EqualizedConv2DTranspose...
[]
Variable 'self' used at line 127 is defined at line 123 and has a Short-Range dependency. Variable 'kernel_size' used at line 127 is defined at line 96 and has a Long-Range dependency. Variable 'self' used at line 128 is defined at line 123 and has a Short-Range dependency. Variable 'strides' used at line 128 is define...
{}
{'Variable Short-Range': 4, 'Variable Long-Range': 4}
infilling_python
GAN_model
136
136
['import sys, os', 'from pathlib import Path', '# sys.path.append(os.path.dirname(os.path.abspath(__file__)))', '', 'import sys, os', 'import glob', '# import imageio', 'import matplotlib.pyplot as plt', 'import numpy as np', 'import os', 'import PIL', 'from tensorflow.keras import layers', 'import time', 'from tensorf...
[" x = tf.nn.conv2d(inputs, filters=self.scale*self.w, strides=self.strides, padding = 'SAME')"]
['', ' x = x + self.b', '', ' return x', '', 'class EqualizedConv2DTranspose(tf.keras.layers.Layer):', ' def __init__(self,', ' filters,', ' kernel_size=(3,3),', ' strides=(1,1), ', ' kernel_initializer=tf.initializers.RandomNormal(seed=42),',...
[]
Library 'tf' used at line 136 is imported at line 16 and has a Long-Range dependency. Variable 'inputs' used at line 136 is defined at line 135 and has a Short-Range dependency. Variable 'self' used at line 136 is defined at line 135 and has a Short-Range dependency. Variable 'scale' used at line 136 is defined at line...
{}
{'Library Long-Range': 1, 'Variable Short-Range': 2, 'Variable Long-Range': 2, 'Variable Medium-Range': 1}
infilling_python
GAN_model
136
138
['import sys, os', 'from pathlib import Path', '# sys.path.append(os.path.dirname(os.path.abspath(__file__)))', '', 'import sys, os', 'import glob', '# import imageio', 'import matplotlib.pyplot as plt', 'import numpy as np', 'import os', 'import PIL', 'from tensorflow.keras import layers', 'import time', 'from tensorf...
[" x = tf.nn.conv2d(inputs, filters=self.scale*self.w, strides=self.strides, padding = 'SAME')", '', ' x = x + self.b']
['', ' return x', '', 'class EqualizedConv2DTranspose(tf.keras.layers.Layer):', ' def __init__(self,', ' filters,', ' kernel_size=(3,3),', ' strides=(1,1), ', ' kernel_initializer=tf.initializers.RandomNormal(seed=42),', ' bias_initial...
[]
Library 'tf' used at line 136 is imported at line 16 and has a Long-Range dependency. Variable 'inputs' used at line 136 is defined at line 135 and has a Short-Range dependency. Variable 'self' used at line 136 is defined at line 135 and has a Short-Range dependency. Variable 'scale' used at line 136 is defined at line...
{}
{'Library Long-Range': 1, 'Variable Short-Range': 4, 'Variable Long-Range': 2, 'Variable Medium-Range': 2}
infilling_python
GAN_model
152
154
['import sys, os', 'from pathlib import Path', '# sys.path.append(os.path.dirname(os.path.abspath(__file__)))', '', 'import sys, os', 'import glob', '# import imageio', 'import matplotlib.pyplot as plt', 'import numpy as np', 'import os', 'import PIL', 'from tensorflow.keras import layers', 'import time', 'from tensorf...
[' super(EqualizedConv2DTranspose, self).__init__(**kwargs)', ' self.filters = filters', ' self.kernel_size = kernel_size']
[' self.strides = strides', ' self.kernel_initializer = kernel_initializer', ' self.bias_initializer = bias_initializer', ' self.gain = gain', '', ' def build(self, input_shape):', ' *_, n_channels = input_shape', ' fan_in = self.kernel_size[0]*self.kernel_size[1]*n_channels...
[]
Class 'EqualizedConv2DTranspose' used at line 152 is defined at line 142 and has a Short-Range dependency. Variable 'self' used at line 152 is defined at line 143 and has a Short-Range dependency. Variable 'self' used at line 153 is defined at line 143 and has a Short-Range dependency. Variable 'filters' used at line 1...
{}
{'Class Short-Range': 1, 'Variable Short-Range': 4, 'Variable Medium-Range': 1}
infilling_python
GAN_model
152
158
['import sys, os', 'from pathlib import Path', '# sys.path.append(os.path.dirname(os.path.abspath(__file__)))', '', 'import sys, os', 'import glob', '# import imageio', 'import matplotlib.pyplot as plt', 'import numpy as np', 'import os', 'import PIL', 'from tensorflow.keras import layers', 'import time', 'from tensorf...
[' super(EqualizedConv2DTranspose, self).__init__(**kwargs)', ' self.filters = filters', ' self.kernel_size = kernel_size', ' self.strides = strides', ' self.kernel_initializer = kernel_initializer', ' self.bias_initializer = bias_initializer', ' self.gain = gain']
['', ' def build(self, input_shape):', ' *_, n_channels = input_shape', ' fan_in = self.kernel_size[0]*self.kernel_size[1]*n_channels', ' self.scale = tf.math.sqrt(self.gain/fan_in)', ' ', ' self.w = self.add_weight(', " name='kernel',", ' shape=(*self...
[]
Class 'EqualizedConv2DTranspose' used at line 152 is defined at line 142 and has a Short-Range dependency. Variable 'self' used at line 152 is defined at line 143 and has a Short-Range dependency. Variable 'self' used at line 153 is defined at line 143 and has a Short-Range dependency. Variable 'filters' used at line 1...
{}
{'Class Short-Range': 1, 'Variable Short-Range': 8, 'Variable Medium-Range': 5}
infilling_python
GAN_model
161
179
['import sys, os', 'from pathlib import Path', '# sys.path.append(os.path.dirname(os.path.abspath(__file__)))', '', 'import sys, os', 'import glob', '# import imageio', 'import matplotlib.pyplot as plt', 'import numpy as np', 'import os', 'import PIL', 'from tensorflow.keras import layers', 'import time', 'from tensorf...
[' *_, n_channels = input_shape', ' fan_in = self.kernel_size[0]*self.kernel_size[1]*n_channels', ' self.scale = tf.math.sqrt(self.gain/fan_in)', ' ', ' self.w = self.add_weight(', " name='kernel',", ' shape=(*self.kernel_size,', ' ...
[' ', ' def get_config(self):', ' config = super().get_config()', ' config.update({', ' "filters": self.filters,', ' "kernel_size": self.kernel_size,', ' "strides": self.strides,', ' "kernel_initializer": self.kernel_initializer,', ' "bias_i...
[]
Variable 'input_shape' used at line 161 is defined at line 160 and has a Short-Range dependency. Variable 'self' used at line 162 is defined at line 160 and has a Short-Range dependency. Variable 'n_channels' used at line 162 is defined at line 161 and has a Short-Range dependency. Variable 'kernel_size' used at line 1...
{}
{'Variable Short-Range': 12, 'Library Long-Range': 3, 'Variable Medium-Range': 8}
infilling_python
GAN_model
162
170
['import sys, os', 'from pathlib import Path', '# sys.path.append(os.path.dirname(os.path.abspath(__file__)))', '', 'import sys, os', 'import glob', '# import imageio', 'import matplotlib.pyplot as plt', 'import numpy as np', 'import os', 'import PIL', 'from tensorflow.keras import layers', 'import time', 'from tensorf...
[' fan_in = self.kernel_size[0]*self.kernel_size[1]*n_channels', ' self.scale = tf.math.sqrt(self.gain/fan_in)', ' ', ' self.w = self.add_weight(', " name='kernel',", ' shape=(*self.kernel_size,', ' self.filters,', ' ...
[' trainable=True,', ' dtype=tf.float32)', '', ' self.b = self.add_weight(', " name='bias',", ' shape=(self.filters,),', ' initializer=self.bias_initializer,', ' trainable=True,', ' dtype=tf.float32)', ' ...
[]
Variable 'self' used at line 162 is defined at line 160 and has a Short-Range dependency. Variable 'n_channels' used at line 162 is defined at line 161 and has a Short-Range dependency. Variable 'kernel_size' used at line 162 is defined at line 154 and has a Short-Range dependency. Variable 'self' used at line 163 is d...
{}
{'Variable Short-Range': 11, 'Library Long-Range': 1, 'Variable Medium-Range': 3}