task_type
stringclasses
4 values
code_task
stringclasses
15 values
start_line
int64
4
1.79k
end_line
int64
4
1.8k
before
stringlengths
79
76.1k
between
stringlengths
17
806
after
stringlengths
2
72.6k
reason_categories_output
stringlengths
2
2.24k
horizon_categories_output
stringlengths
83
3.99k
reason_freq_analysis
stringclasses
150 values
horizon_freq_analysis
stringlengths
23
185
completion_python
Credit_Scoring_Fairness
194
194
['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 =...
[]
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': 1, 'Variable Long-Range': 3}
completion_python
Credit_Scoring_Fairness
330
330
['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', 'accu...
[]
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': 1, 'Variable Long-Range': 3}
completion_python
Credit_Scoring_Fairness
471
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.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\'])']
[]
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 at line 471 is defined at line 39 and has a Long-Range dependency. Variable 'linear_regression_m...
{}
{'Variable Short-Range': 2, 'Variable Long-Range': 3}
completion_python
Credit_Scoring_Fairness
472
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...
['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\'])']
[]
Variable 'linear_regression_model' used at line 472 is defined at line 470 and has a Short-Range dependency. Variable 'x_test' used at line 472 is defined at line 39 and has a Long-Range dependency.
{}
{'Variable Short-Range': 1, 'Variable Long-Range': 1}
completion_python
GAN_model
25
25
['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.activations.swish(x)']
['', 'def relu(x):', ' return tf.keras.activations.relu(x)', '', 'def leakyrelu(x):', ' 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=Tr...
[]
Library 'tf' used at line 25 is imported at line 16 and has a Short-Range dependency. Variable 'x' used at line 25 is defined at line 24 and has a Short-Range dependency.
{}
{'Library Short-Range': 1, 'Variable Short-Range': 1}
completion_python
GAN_model
28
28
['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.activations.relu(x)']
['', 'def leakyrelu(x):', ' 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.BatchNormali...
[]
Library 'tf' used at line 28 is imported at line 16 and has a Medium-Range dependency. Variable 'x' used at line 28 is defined at line 27 and has a Short-Range dependency.
{}
{'Library Medium-Range': 1, 'Variable Short-Range': 1}
completion_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}
completion_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}
completion_python
GAN_model
40
40
['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 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 than) group_size.', ' group_size = tf.minimum(group_size, tf.shape(x)[0]) ',...
[]
Library 'layers' used at line 40 is imported at line 12 and has a Medium-Range dependency. Variable 'x' used at line 40 is defined at line 39 and has a Short-Range dependency.
{}
{'Library Medium-Range': 1, 'Variable Short-Range': 1}
completion_python
GAN_model
67
69
['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 layers.UpSampling2D(', " size=(factor, factor), interpolation='nearest'", ' )(x)']
['', 'def upsample(x, filters, kernel_size=(3, 3), padding="same", factor=2):', ' return layers.Conv2DTranspose(filters, kernel_size,', ' strides=(factor, factor), padding=padding)(x)', '', 'def avgpooling2D(x,factor=2):', " return layers.AveragePooling2D(pool_size=(2, 2),stride...
[]
Library 'layers' used at line 67 is imported at line 12 and has a Long-Range dependency. Variable 'factor' used at line 68 is defined at line 66 and has a Short-Range dependency. Variable 'x' used at line 69 is defined at line 66 and has a Short-Range dependency.
{}
{'Library Long-Range': 1, 'Variable Short-Range': 2}
completion_python
GAN_model
72
73
['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 layers.Conv2DTranspose(filters, kernel_size,', ' strides=(factor, factor), padding=padding)(x)']
['', 'def avgpooling2D(x,factor=2):', " return layers.AveragePooling2D(pool_size=(2, 2),strides=(factor, factor), padding='same')(x)", '', '', '#Build custom tensorflow layers for equalised 2d convolution, equalised 2d transpose convolution and equalised dense layer', '#scale the weights dynamically by the sqrt(gain...
[]
Library 'layers' used at line 72 is imported at line 12 and has a Long-Range dependency. Variable 'filters' used at line 72 is defined at line 71 and has a Short-Range dependency. Variable 'kernel_size' used at line 72 is defined at line 71 and has a Short-Range dependency. Variable 'factor' used at line 73 is defined ...
{}
{'Library Long-Range': 1, 'Variable Short-Range': 5}
completion_python
GAN_model
76
76
['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 layers.AveragePooling2D(pool_size=(2, 2),strides=(factor, factor), padding='same')(x)"]
['', '', '#Build custom tensorflow layers for equalised 2d convolution, equalised 2d transpose convolution and equalised dense layer', '#scale the weights dynamically by the sqrt(gain/(kernalh*kernelw*numberchannels))', '#apply this scaling as an input into convolution/dense function, do not scale the bias', '#make sur...
[]
Library 'layers' used at line 76 is imported at line 12 and has a Long-Range dependency. Variable 'factor' used at line 76 is defined at line 75 and has a Short-Range dependency. Variable 'x' used at line 76 is defined at line 75 and has a Short-Range dependency.
{}
{'Library Long-Range': 1, 'Variable Short-Range': 2}
completion_python
GAN_model
107
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...
[' self.w = self.add_weight(', " name='kernel',", ' shape=(*self.kernel_size,', ' n_channels,', ' self.filters),', ' initializer=self.kernel_initializer,', ' trainable=True,', ' dtype=...
[' ', ' 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 107 is defined at line 102 and has a Short-Range dependency. 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 d...
{}
{'Variable Short-Range': 5, 'Variable Medium-Range': 8, 'Library Long-Range': 2}
completion_python
GAN_model
125
133
['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...
[' config.update({', ' "filters": self.filters,', ' "kernel_size": self.kernel_size,', ' "strides": self.strides,', ' "kernel_initializer": self.kernel_initializer,', ' "bias_initializer": self.bias_initializer,', ' "gain": self.gain,', ' }...
[' ', ' 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(tf.keras.layers.Layer):', ' def __init__(self,', ' fil...
[]
Variable 'config' used at line 125 is defined at line 124 and has a Short-Range dependency. Variable 'self' used at line 126 is defined at line 123 and has a Short-Range dependency. Variable 'filters' used at line 126 is defined at line 95 and has a Long-Range dependency. Variable 'self' used at line 127 is defined at ...
{}
{'Variable Short-Range': 8, 'Variable Long-Range': 6}
completion_python
GAN_model
136
140
['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_initializer=tf.initializers.Zer...
[]
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': 5, 'Variable Long-Range': 2, 'Variable Medium-Range': 2}
completion_python
GAN_model
138
140
['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 = 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_initializer=tf.initializers.Zer...
[]
Variable 'self' used at line 138 is defined at line 135 and has a Short-Range dependency. Variable 'b' used at line 138 is defined at line 116 and has a Medium-Range dependency. Variable 'x' used at line 138 is defined at line 136 and has a Short-Range dependency. Variable 'x' used at line 140 is defined at line 138 an...
{}
{'Variable Short-Range': 3, 'Variable Medium-Range': 1}
completion_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}
completion_python
GAN_model
154
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...
[' 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 154 is defined at line 143 and has a Medium-Range dependency. Variable 'kernel_size' used at line 154 is defined at line 145 and has a Short-Range dependency. Variable 'self' used at line 155 is defined at line 143 and has a Medium-Range dependency. Variable 'strides' used at line 155 is de...
{}
{'Variable Medium-Range': 5, 'Variable Short-Range': 5}
completion_python
GAN_model
165
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...
[' self.w = self.add_weight(', " name='kernel',", ' shape=(*self.kernel_size,', ' self.filters,', ' n_channels),', ' initializer=self.kernel_initializer,', ' trainable=True,', ' dtype=...
[' ', ' 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 165 is defined at line 160 and has a Short-Range dependency. Variable 'self' used at line 167 is defined at line 160 and has a Short-Range dependency. Variable 'kernel_size' used at line 167 is defined at line 154 and has a Medium-Range dependency. Variable 'self' used at line 168 is define...
{}
{'Variable Short-Range': 5, 'Variable Medium-Range': 8, 'Library Long-Range': 2}
completion_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}
completion_python
GAN_model
187
191
['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_initializer": self.kernel_initializer,', ' "bias_initializer": self.bias_initializer,', ' "gain": self.gain,', ' })', ' return config']
['', ' def call(self, inputs, training=None):', ' x = tf.nn.conv2d_transpose(inputs, filters=self.scale*self.w,', ' output_shape = (inputs.shape[1]*self.strides[0],inputs.shape[2]*self.strides[1]),', ' strides=self.strides,', " ...
[]
Variable 'self' used at line 187 is defined at line 181 and has a Short-Range dependency. Variable 'kernel_initializer' used at line 187 is defined at line 156 and has a Long-Range dependency. Variable 'self' used at line 188 is defined at line 181 and has a Short-Range dependency. Variable 'bias_initializer' used at l...
{}
{'Variable Short-Range': 4, 'Variable Long-Range': 3}
completion_python
GAN_model
199
201
['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 = x + self.b', '', ' return x']
['', 'class EqualizedDense(layers.Layer):', ' def __init__(self,', ' units=1,', ' kernel_initializer=tf.initializers.RandomNormal(seed=42),', ' bias_initializer=tf.initializers.Zeros(),', ' gain=2,', ' **kwargs):', ' ', ' super(...
[]
Variable 'self' used at line 199 is defined at line 193 and has a Short-Range dependency. Variable 'b' used at line 199 is defined at line 174 and has a Medium-Range dependency. Variable 'x' used at line 199 is defined at line 194 and has a Short-Range dependency. Variable 'x' used at line 201 is defined at line 199 an...
{}
{'Variable Short-Range': 3, 'Variable Medium-Range': 1}
completion_python
GAN_model
194
201
['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_transpose(inputs, filters=self.scale*self.w,', ' output_shape = (inputs.shape[1]*self.strides[0],inputs.shape[2]*self.strides[1]),', ' strides=self.strides,', " padding = 'SAME')", '', ' x = x ...
['', 'class EqualizedDense(layers.Layer):', ' def __init__(self,', ' units=1,', ' kernel_initializer=tf.initializers.RandomNormal(seed=42),', ' bias_initializer=tf.initializers.Zeros(),', ' gain=2,', ' **kwargs):', ' ', ' super(...
[]
Library 'tf' used at line 194 is imported at line 16 and has a Long-Range dependency. Variable 'inputs' used at line 194 is defined at line 193 and has a Short-Range dependency. Variable 'self' used at line 194 is defined at line 193 and has a Short-Range dependency. Variable 'scale' used at line 194 is defined at line...
{}
{'Library Long-Range': 1, 'Variable Short-Range': 8, 'Variable Long-Range': 3, 'Variable Medium-Range': 2}
completion_python
GAN_model
213
216
['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.units = units', ' self.kernel_initializer = kernel_initializer', ' self.bias_initializer = bias_initializer', ' self.gain = gain']
[' ', ' ', ' def build(self, input_shape):', ' ', ' *_, n_channels = input_shape', ' ', ' self.scale = tf.math.sqrt(self.gain/n_channels)', ' ', ' self.w = self.add_weight(', " name='kernel',", ' shape=(n_channels,', ' ...
[]
Variable 'self' used at line 213 is defined at line 204 and has a Short-Range dependency. Variable 'units' used at line 213 is defined at line 205 and has a Short-Range dependency. Variable 'self' used at line 214 is defined at line 204 and has a Short-Range dependency. Variable 'kernel_initializer' used at line 214 is...
{}
{'Variable Short-Range': 6, 'Variable Medium-Range': 2}
completion_python
GAN_model
221
238
['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', ' ', ' self.scale = tf.math.sqrt(self.gain/n_channels)', ' ', ' self.w = self.add_weight(', " name='kernel',", ' shape=(n_channels,', ' self.units),', ' initializer=self.kernel_initia...
[' ', ' def get_config(self):', ' config = super().get_config()', ' config.update({', ' "units": self.units,', ' "kernel_initializer": self.kernel_initializer,', ' "bias_initializer": self.bias_initializer,', ' "gain": self.gain,', ' })', ' ...
[]
Variable 'input_shape' used at line 221 is defined at line 219 and has a Short-Range dependency. Variable 'self' used at line 223 is defined at line 219 and has a Short-Range dependency. Library 'tf' used at line 223 is imported at line 16 and has a Long-Range dependency. Variable 'n_channels' used at line 223 is defin...
{}
{'Variable Short-Range': 8, 'Library Long-Range': 3, 'Variable Medium-Range': 7}
completion_python
GAN_model
225
238
['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.w = self.add_weight(', " name='kernel',", ' shape=(n_channels,', ' self.units),', ' initializer=self.kernel_initializer,', ' trainable=True,', ' dtype=tf.float32)', ' ', ' self.b = self.add_wei...
[' ', ' def get_config(self):', ' config = super().get_config()', ' config.update({', ' "units": self.units,', ' "kernel_initializer": self.kernel_initializer,', ' "bias_initializer": self.bias_initializer,', ' "gain": self.gain,', ' })', ' ...
[]
Variable 'self' used at line 225 is defined at line 219 and has a Short-Range dependency. Variable 'n_channels' used at line 227 is defined at line 221 and has a Short-Range dependency. Variable 'self' used at line 228 is defined at line 219 and has a Short-Range dependency. Variable 'units' used at line 228 is defined...
{}
{'Variable Short-Range': 4, 'Variable Medium-Range': 7, 'Library Long-Range': 2}
completion_python
GAN_model
233
238
['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.b = self.add_weight(', " name='bias',", ' shape=(self.units,),', ' initializer=self.bias_initializer,', ' trainable=True,', ' dtype=tf.float32)']
[' ', ' def get_config(self):', ' config = super().get_config()', ' config.update({', ' "units": self.units,', ' "kernel_initializer": self.kernel_initializer,', ' "bias_initializer": self.bias_initializer,', ' "gain": self.gain,', ' })', ' ...
[]
Variable 'self' used at line 233 is defined at line 219 and has a Medium-Range dependency. Variable 'self' used at line 235 is defined at line 219 and has a Medium-Range dependency. Variable 'units' used at line 235 is defined at line 213 and has a Medium-Range dependency. Variable 'self' used at line 236 is defined at...
{}
{'Variable Medium-Range': 5, 'Library Long-Range': 1}
completion_python
GAN_model
241
248
['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...
[' config = super().get_config()', ' config.update({', ' "units": self.units,', ' "kernel_initializer": self.kernel_initializer,', ' "bias_initializer": self.bias_initializer,', ' "gain": self.gain,', ' })', ' return config']
[' ', ' def call(self, inputs):', ' return tf.matmul(inputs,self.scale*self.w) + self.b', '', '#### # Test the custom layers', 'tf.random.set_seed(42)', 'input_shape = (1, 8, 8, 3)', 'x = tf.random.normal(input_shape)', '', 'equalized_conv2d = EqualizedConv2D(filters=16, kernel_size=(3, 3))', 'output_equal...
[]
Variable 'config' used at line 242 is defined at line 241 and has a Short-Range dependency. Variable 'self' used at line 243 is defined at line 240 and has a Short-Range dependency. Variable 'units' used at line 243 is defined at line 213 and has a Medium-Range dependency. Variable 'self' used at line 244 is defined at...
{}
{'Variable Short-Range': 6, 'Variable Medium-Range': 4}
completion_python
GAN_model
242
248
['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...
[' config.update({', ' "units": self.units,', ' "kernel_initializer": self.kernel_initializer,', ' "bias_initializer": self.bias_initializer,', ' "gain": self.gain,', ' })', ' return config']
[' ', ' def call(self, inputs):', ' return tf.matmul(inputs,self.scale*self.w) + self.b', '', '#### # Test the custom layers', 'tf.random.set_seed(42)', 'input_shape = (1, 8, 8, 3)', 'x = tf.random.normal(input_shape)', '', 'equalized_conv2d = EqualizedConv2D(filters=16, kernel_size=(3, 3))', 'output_equal...
[]
Variable 'config' used at line 242 is defined at line 241 and has a Short-Range dependency. Variable 'self' used at line 243 is defined at line 240 and has a Short-Range dependency. Variable 'units' used at line 243 is defined at line 213 and has a Medium-Range dependency. Variable 'self' used at line 244 is defined at...
{}
{'Variable Short-Range': 6, 'Variable Medium-Range': 4}
completion_python
GAN_model
248
248
['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 config']
[' ', ' def call(self, inputs):', ' return tf.matmul(inputs,self.scale*self.w) + self.b', '', '#### # Test the custom layers', 'tf.random.set_seed(42)', 'input_shape = (1, 8, 8, 3)', 'x = tf.random.normal(input_shape)', '', 'equalized_conv2d = EqualizedConv2D(filters=16, kernel_size=(3, 3))', 'output_equal...
[]
Variable 'config' used at line 248 is defined at line 241 and has a Short-Range dependency.
{}
{'Variable Short-Range': 1}
completion_python
GAN_model
251
251
['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.matmul(inputs,self.scale*self.w) + self.b']
['', '#### # Test the custom layers', 'tf.random.set_seed(42)', 'input_shape = (1, 8, 8, 3)', 'x = tf.random.normal(input_shape)', '', 'equalized_conv2d = EqualizedConv2D(filters=16, kernel_size=(3, 3))', 'output_equalized_conv2d = equalized_conv2d(x)', "print('conv2d_equal',output_equalized_conv2d.shape)", "print('con...
[]
Library 'tf' used at line 251 is imported at line 16 and has a Long-Range dependency. Variable 'inputs' used at line 251 is defined at line 250 and has a Short-Range dependency. Variable 'self' used at line 251 is defined at line 250 and has a Short-Range dependency. Variable 'scale' used at line 251 is defined at line...
{}
{'Library Long-Range': 1, 'Variable Short-Range': 2, 'Variable Medium-Range': 3}
completion_python
GAN_model
291
299
['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 = EqualizedConv2D(filters, ', ' kernel_size=(3,3), ', ' strides=(1,1),', ' kernel_initializer=kernel_init)(x)', ' ', ' x = norm_func(act_func(x))', ' ', ' model = tf.keras.models.Model(inputs, [x,x])', ' return model']
['', '#instantiate the U gen bottom initial block and print layer shapes', 'U_gen_bottom_init_layer_shape_lst = []', 'U_gen_bottom_init_fn = U_gen_bottom_init(leakyrelu, pixelnorm, 512, kernel_init=tf.keras.initializers.RandomNormal(mean=0.0, stddev=1.0,seed=42)) ', 'for layer in U_gen_bottom_init_fn.layers:', ' U_g...
[]
Class 'EqualizedConv2D' used at line 291 is defined at line 83 and has a Long-Range dependency. Variable 'filters' used at line 291 is defined at line 281 and has a Short-Range dependency. Variable 'kernel_init' used at line 294 is defined at line 282 and has a Medium-Range dependency. Variable 'x' used at line 294 is ...
{}
{'Class Long-Range': 1, 'Variable Short-Range': 4, 'Variable Medium-Range': 4, 'Library Long-Range': 1}
completion_python
GAN_model
296
299
['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 = norm_func(act_func(x))', ' ', ' model = tf.keras.models.Model(inputs, [x,x])', ' return model']
['', '#instantiate the U gen bottom initial block and print layer shapes', 'U_gen_bottom_init_layer_shape_lst = []', 'U_gen_bottom_init_fn = U_gen_bottom_init(leakyrelu, pixelnorm, 512, kernel_init=tf.keras.initializers.RandomNormal(mean=0.0, stddev=1.0,seed=42)) ', 'for layer in U_gen_bottom_init_fn.layers:', ' U_g...
[]
Variable 'norm_func' used at line 296 is defined at line 280 and has a Medium-Range dependency. Variable 'act_func' used at line 296 is defined at line 279 and has a Medium-Range dependency. Library 'tf' used at line 298 is imported at line 15 and has a Long-Range dependency. Variable 'inputs' used at line 298 is defin...
{}
{'Variable Medium-Range': 3, 'Library Long-Range': 1, 'Variable Short-Range': 2}
completion_python
GAN_model
298
299
['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...
[' model = tf.keras.models.Model(inputs, [x,x])', ' return model']
['', '#instantiate the U gen bottom initial block and print layer shapes', 'U_gen_bottom_init_layer_shape_lst = []', 'U_gen_bottom_init_fn = U_gen_bottom_init(leakyrelu, pixelnorm, 512, kernel_init=tf.keras.initializers.RandomNormal(mean=0.0, stddev=1.0,seed=42)) ', 'for layer in U_gen_bottom_init_fn.layers:', ' U_g...
[]
Library 'tf' used at line 298 is imported at line 15 and has a Long-Range dependency. Variable 'inputs' used at line 298 is defined at line 284 and has a Medium-Range dependency. Variable 'x' used at line 298 is defined at line 296 and has a Short-Range dependency. Variable 'model' used at line 299 is defined at line 2...
{}
{'Library Long-Range': 1, 'Variable Medium-Range': 1, 'Variable Short-Range': 2}
completion_python
GAN_model
328
339
['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 = norm_func(act_func(EqualizedConv2D(filters,', ' kernel_size=(3,3), ', ' strides=(1,1),', ' kernel_initializer=kernel_init)(upsample)))', ' ', ' x = norm_func(act_func(EqualizedConv2D(filt...
['', '#instantiate the U gen bottom additional blocks and print layer shapes', 'U_gen_bottom_add_fn_layer_shape_lst = []', 'U_gen_bottom_add_fn = U_gen_bottom_add(leakyrelu, pixelnorm,upsample_d, (4,4,512), 512, kernel_init=tf.keras.initializers.RandomNormal(mean=0.0, stddev=1.0,seed=42)) ', 'for layer in U_gen_bottom_...
[]
Variable 'norm_func' used at line 328 is defined at line 317 and has a Medium-Range dependency. Variable 'act_func' used at line 328 is defined at line 316 and has a Medium-Range dependency. Class 'EqualizedConv2D' used at line 328 is defined at line 83 and has a Long-Range dependency. Variable 'filters' used at line 3...
{}
{'Variable Medium-Range': 8, 'Class Long-Range': 2, 'Variable Short-Range': 6, 'Library Long-Range': 1}
completion_python
GAN_model
333
339
['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 = norm_func(act_func(EqualizedConv2D(filters,', ' kernel_size=(3,3), ', ' strides=(1,1),', ' kernel_initializer=kernel_init)(x)))', ' ', ' model = tf.keras.models.Model(inputs, [x,upsample]...
['', '#instantiate the U gen bottom additional blocks and print layer shapes', 'U_gen_bottom_add_fn_layer_shape_lst = []', 'U_gen_bottom_add_fn = U_gen_bottom_add(leakyrelu, pixelnorm,upsample_d, (4,4,512), 512, kernel_init=tf.keras.initializers.RandomNormal(mean=0.0, stddev=1.0,seed=42)) ', 'for layer in U_gen_bottom_...
[]
Variable 'norm_func' used at line 333 is defined at line 317 and has a Medium-Range dependency. Variable 'act_func' used at line 333 is defined at line 316 and has a Medium-Range dependency. Class 'EqualizedConv2D' used at line 333 is defined at line 83 and has a Long-Range dependency. Variable 'filters' used at line 3...
{}
{'Variable Medium-Range': 6, 'Class Long-Range': 1, 'Variable Short-Range': 3, 'Library Long-Range': 1}
completion_python
GAN_model
338
339
['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...
[' model = tf.keras.models.Model(inputs, [x,upsample])', ' return model ']
['', '#instantiate the U gen bottom additional blocks and print layer shapes', 'U_gen_bottom_add_fn_layer_shape_lst = []', 'U_gen_bottom_add_fn = U_gen_bottom_add(leakyrelu, pixelnorm,upsample_d, (4,4,512), 512, kernel_init=tf.keras.initializers.RandomNormal(mean=0.0, stddev=1.0,seed=42)) ', 'for layer in U_gen_bottom_...
[]
Library 'tf' used at line 338 is imported at line 15 and has a Long-Range dependency. Variable 'inputs' used at line 338 is defined at line 324 and has a Medium-Range dependency. Variable 'x' used at line 338 is defined at line 333 and has a Short-Range dependency. Variable 'upsample' used at line 338 is defined at lin...
{}
{'Library Long-Range': 1, 'Variable Medium-Range': 2, 'Variable Short-Range': 2}
completion_python
GAN_model
370
381
['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 = act_func(x)', ' ', ' x = EqualizedConv2D(filters, ', ' kernel_size=(4,4), ', ' strides=(4,4),', ' kernel_initializer=kernel_init)(x)', ' ', ' ', ' x = act_func(x)', ' ', ' model = tf.keras.models.Model(inputs, x)...
['', '#instantiate the U gen top initial blocks and print layer shapes', 'U_gen_top_init_layer_shape_lst = []', 'U_gen_top_init_fn = U_gen_top_init(leakyrelu, 512, kernel_init=tf.keras.initializers.RandomNormal(mean=0.0, stddev=1.0,seed=42)) ', 'for layer in U_gen_top_init_fn.layers:', ' U_gen_top_init_layer_shape_l...
[]
Variable 'act_func' used at line 370 is defined at line 358 and has a Medium-Range dependency. Class 'EqualizedConv2D' used at line 372 is defined at line 83 and has a Long-Range dependency. Variable 'filters' used at line 372 is defined at line 359 and has a Medium-Range dependency. Variable 'kernel_init' used at line...
{}
{'Variable Medium-Range': 5, 'Class Long-Range': 1, 'Variable Short-Range': 4, 'Library Long-Range': 1}
completion_python
GAN_model
372
381
['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 = EqualizedConv2D(filters, ', ' kernel_size=(4,4), ', ' strides=(4,4),', ' kernel_initializer=kernel_init)(x)', ' ', ' ', ' x = act_func(x)', ' ', ' model = tf.keras.models.Model(inputs, x)', ' return model']
['', '#instantiate the U gen top initial blocks and print layer shapes', 'U_gen_top_init_layer_shape_lst = []', 'U_gen_top_init_fn = U_gen_top_init(leakyrelu, 512, kernel_init=tf.keras.initializers.RandomNormal(mean=0.0, stddev=1.0,seed=42)) ', 'for layer in U_gen_top_init_fn.layers:', ' U_gen_top_init_layer_shape_l...
[]
Class 'EqualizedConv2D' used at line 372 is defined at line 83 and has a Long-Range dependency. Variable 'filters' used at line 372 is defined at line 359 and has a Medium-Range dependency. Variable 'kernel_init' used at line 375 is defined at line 360 and has a Medium-Range dependency. Variable 'x' used at line 375 is...
{}
{'Class Long-Range': 1, 'Variable Medium-Range': 4, 'Variable Short-Range': 4, 'Library Long-Range': 1}
completion_python
GAN_model
378
381
['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 = act_func(x)', ' ', ' model = tf.keras.models.Model(inputs, x)', ' return model']
['', '#instantiate the U gen top initial blocks and print layer shapes', 'U_gen_top_init_layer_shape_lst = []', 'U_gen_top_init_fn = U_gen_top_init(leakyrelu, 512, kernel_init=tf.keras.initializers.RandomNormal(mean=0.0, stddev=1.0,seed=42)) ', 'for layer in U_gen_top_init_fn.layers:', ' U_gen_top_init_layer_shape_l...
[]
Variable 'act_func' used at line 378 is defined at line 358 and has a Medium-Range dependency. Variable 'x' used at line 378 is defined at line 372 and has a Short-Range dependency. Library 'tf' used at line 380 is imported at line 15 and has a Long-Range dependency. Variable 'inputs' used at line 380 is defined at lin...
{}
{'Variable Medium-Range': 2, 'Variable Short-Range': 3, 'Library Long-Range': 1}
completion_python
GAN_model
380
381
['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...
[' model = tf.keras.models.Model(inputs, x)', ' return model']
['', '#instantiate the U gen top initial blocks and print layer shapes', 'U_gen_top_init_layer_shape_lst = []', 'U_gen_top_init_fn = U_gen_top_init(leakyrelu, 512, kernel_init=tf.keras.initializers.RandomNormal(mean=0.0, stddev=1.0,seed=42)) ', 'for layer in U_gen_top_init_fn.layers:', ' U_gen_top_init_layer_shape_l...
[]
Library 'tf' used at line 380 is imported at line 15 and has a Long-Range dependency. Variable 'inputs' used at line 380 is defined at line 362 and has a Medium-Range dependency. Variable 'x' used at line 380 is defined at line 378 and has a Short-Range dependency. Variable 'model' used at line 381 is defined at line 3...
{}
{'Library Long-Range': 1, 'Variable Medium-Range': 1, 'Variable Short-Range': 2}
completion_python
GAN_model
405
418
['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...
[' inputs = layers.Input(shape = (image_shape[0],image_shape[1],filters1))', ' ', ' x = act_func(EqualizedConv2D(filters1,', ' kernel_size=(3,3), ', ' strides=(1,1),', ' kernel_initializer=kernel_init)(inputs))', ' ...
['#instantiate the U gen top additional blocks and print layer shapes', 'U_gen_top_add_layer_shape_lst = []', 'U_gen_top_add_fn = U_gen_top_add(leakyrelu, avgpooling2D, 512,512,(8,8,512), kernel_init=tf.keras.initializers.RandomNormal(mean=0.0, stddev=1.0,seed=42)) ', 'for layer in U_gen_top_add_fn.layers:', ' U_gen...
[]
Library 'layers' used at line 405 is imported at line 11 and has a Long-Range dependency. Variable 'image_shape' used at line 405 is defined at line 402 and has a Short-Range dependency. Variable 'filters1' used at line 405 is defined at line 400 and has a Short-Range dependency. Variable 'act_func' used at line 407 is...
{}
{'Library Long-Range': 2, 'Variable Short-Range': 11, 'Class Long-Range': 2, 'Variable Medium-Range': 4}
completion_python
GAN_model
407
418
['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 = act_func(EqualizedConv2D(filters1,', ' kernel_size=(3,3), ', ' strides=(1,1),', ' kernel_initializer=kernel_init)(inputs))', ' x = act_func(EqualizedConv2D(filters2, ', ' kernel_size=...
['#instantiate the U gen top additional blocks and print layer shapes', 'U_gen_top_add_layer_shape_lst = []', 'U_gen_top_add_fn = U_gen_top_add(leakyrelu, avgpooling2D, 512,512,(8,8,512), kernel_init=tf.keras.initializers.RandomNormal(mean=0.0, stddev=1.0,seed=42)) ', 'for layer in U_gen_top_add_fn.layers:', ' U_gen...
[]
Variable 'act_func' used at line 407 is defined at line 398 and has a Short-Range dependency. Class 'EqualizedConv2D' used at line 407 is defined at line 83 and has a Long-Range dependency. Variable 'filters1' used at line 407 is defined at line 400 and has a Short-Range dependency. Variable 'kernel_init' used at line ...
{}
{'Variable Short-Range': 9, 'Class Long-Range': 2, 'Variable Medium-Range': 4, 'Library Long-Range': 1}
completion_python
GAN_model
411
418
['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 = act_func(EqualizedConv2D(filters2, ', ' kernel_size=(3,3), ', ' strides=(1,1), ', ' kernel_initializer=kernel_init)(x))', ' x = downsample_func(x)', ' ', ' model = tf.keras.models.Model(inputs, x)', ' retu...
['#instantiate the U gen top additional blocks and print layer shapes', 'U_gen_top_add_layer_shape_lst = []', 'U_gen_top_add_fn = U_gen_top_add(leakyrelu, avgpooling2D, 512,512,(8,8,512), kernel_init=tf.keras.initializers.RandomNormal(mean=0.0, stddev=1.0,seed=42)) ', 'for layer in U_gen_top_add_fn.layers:', ' U_gen...
[]
Variable 'act_func' used at line 411 is defined at line 398 and has a Medium-Range dependency. Class 'EqualizedConv2D' used at line 411 is defined at line 83 and has a Long-Range dependency. Variable 'filters2' used at line 411 is defined at line 401 and has a Short-Range dependency. Variable 'kernel_init' used at line...
{}
{'Variable Medium-Range': 4, 'Class Long-Range': 1, 'Variable Short-Range': 5, 'Library Long-Range': 1}
completion_python
GAN_model
415
418
['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 = downsample_func(x)', ' ', ' model = tf.keras.models.Model(inputs, x)', ' return model']
['#instantiate the U gen top additional blocks and print layer shapes', 'U_gen_top_add_layer_shape_lst = []', 'U_gen_top_add_fn = U_gen_top_add(leakyrelu, avgpooling2D, 512,512,(8,8,512), kernel_init=tf.keras.initializers.RandomNormal(mean=0.0, stddev=1.0,seed=42)) ', 'for layer in U_gen_top_add_fn.layers:', ' U_gen...
[]
Variable 'downsample_func' used at line 415 is defined at line 399 and has a Medium-Range dependency. Variable 'x' used at line 415 is defined at line 411 and has a Short-Range dependency. Library 'tf' used at line 417 is imported at line 15 and has a Long-Range dependency. Variable 'inputs' used at line 417 is defined...
{}
{'Variable Medium-Range': 2, 'Variable Short-Range': 3, 'Library Long-Range': 1}
completion_python
GAN_model
437
438
['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 = top(inputs)', ' x = bottom(x)']
['', ' else:', ' h = top(inputs)', ' x, _ = center(h)', ' x = x+h', ' x = bottom(x)', ' ', ' model = tf.keras.models.Model(inputs, x)', ' return model', '#unit test U_connect', 'top_G = U_gen_top_init_fn', 'bottom_G = U_gen_bottom_init_fn', 'center_G = None', '', 'u_conn_list_sha...
[{'reason_category': 'If Body', 'usage_line': 437}, {'reason_category': 'If Body', 'usage_line': 438}]
Variable 'top' used at line 437 is defined at line 432 and has a Short-Range dependency. Variable 'inputs' used at line 437 is defined at line 434 and has a Short-Range dependency. Variable 'bottom' used at line 438 is defined at line 432 and has a Short-Range dependency. Variable 'x' used at line 438 is defined at lin...
{'If Body': 2}
{'Variable Short-Range': 4}
completion_python
GAN_model
441
444
['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...
[' h = top(inputs)', ' x, _ = center(h)', ' x = x+h', ' x = bottom(x)']
[' ', ' model = tf.keras.models.Model(inputs, x)', ' return model', '#unit test U_connect', 'top_G = U_gen_top_init_fn', 'bottom_G = U_gen_bottom_init_fn', 'center_G = None', '', 'u_conn_list_shape_lst=[]', 'U_connect_fn = U_connect(top_G, bottom_G, center_G, (4,4), 512)', 'for layer in U_connect_fn.layers:', ...
[{'reason_category': 'Else Reasoning', 'usage_line': 441}, {'reason_category': 'Else Reasoning', 'usage_line': 442}, {'reason_category': 'Else Reasoning', 'usage_line': 443}, {'reason_category': 'Else Reasoning', 'usage_line': 444}]
Variable 'top' used at line 441 is defined at line 432 and has a Short-Range dependency. Variable 'inputs' used at line 441 is defined at line 434 and has a Short-Range dependency. Variable 'center' used at line 442 is defined at line 432 and has a Short-Range dependency. Variable 'h' used at line 442 is defined at lin...
{'Else Reasoning': 4}
{'Variable Short-Range': 6, 'Variable Medium-Range': 1}
completion_python
GAN_model
434
447
['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...
[' inputs = layers.Input(shape = (input_shape[0],input_shape[1],filters)) ', ' ', ' if center == None: ', ' x = top(inputs)', ' x = bottom(x)', '', ' else:', ' h = top(inputs)', ' x, _ = center(h)', ' x = x+h', ' x = bottom(x)', ' ', ' model = tf.ker...
['#unit test U_connect', 'top_G = U_gen_top_init_fn', 'bottom_G = U_gen_bottom_init_fn', 'center_G = None', '', 'u_conn_list_shape_lst=[]', 'U_connect_fn = U_connect(top_G, bottom_G, center_G, (4,4), 512)', 'for layer in U_connect_fn.layers:', ' u_conn_list_shape_lst.append(layer.output_shape)', 'print(u_conn_list_s...
[{'reason_category': 'If Condition', 'usage_line': 436}, {'reason_category': 'If Body', 'usage_line': 437}, {'reason_category': 'If Body', 'usage_line': 438}, {'reason_category': 'Else Reasoning', 'usage_line': 440}, {'reason_category': 'Else Reasoning', 'usage_line': 441}, {'reason_category': 'Else Reasoning', 'usage_...
Library 'layers' used at line 434 is imported at line 11 and has a Long-Range dependency. Variable 'input_shape' used at line 434 is defined at line 432 and has a Short-Range dependency. Variable 'filters' used at line 434 is defined at line 432 and has a Short-Range dependency. Variable 'center' used at line 436 is de...
{'If Condition': 1, 'If Body': 2, 'Else Reasoning': 5}
{'Library Long-Range': 2, 'Variable Short-Range': 15, 'Variable Medium-Range': 2}
completion_python
GAN_model
440
447
['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...
[' else:', ' h = top(inputs)', ' x, _ = center(h)', ' x = x+h', ' x = bottom(x)', ' ', ' model = tf.keras.models.Model(inputs, x)', ' return model']
['#unit test U_connect', 'top_G = U_gen_top_init_fn', 'bottom_G = U_gen_bottom_init_fn', 'center_G = None', '', 'u_conn_list_shape_lst=[]', 'U_connect_fn = U_connect(top_G, bottom_G, center_G, (4,4), 512)', 'for layer in U_connect_fn.layers:', ' u_conn_list_shape_lst.append(layer.output_shape)', 'print(u_conn_list_s...
[{'reason_category': 'Else Reasoning', 'usage_line': 440}, {'reason_category': 'Else Reasoning', 'usage_line': 441}, {'reason_category': 'Else Reasoning', 'usage_line': 442}, {'reason_category': 'Else Reasoning', 'usage_line': 443}, {'reason_category': 'Else Reasoning', 'usage_line': 444}]
Variable 'top' used at line 441 is defined at line 432 and has a Short-Range dependency. Variable 'inputs' used at line 441 is defined at line 434 and has a Short-Range dependency. Variable 'center' used at line 442 is defined at line 432 and has a Short-Range dependency. Variable 'h' used at line 442 is defined at lin...
{'Else Reasoning': 5}
{'Variable Short-Range': 8, 'Variable Medium-Range': 2, 'Library Long-Range': 1}
completion_python
GAN_model
484
493
['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...
[' h = downsample_func(inputs)', ' ', ' h = act_func(EqualizedConv2D(filters2, ', ' kernel_size=(1,1), ', ' strides=(1,1),', ' kernel_initializer=kernel_init)(h))', '', ' fade_in = (1-alp...
['', ' x,upsample = bottom(x)', ' ', ' if x.shape[1] == 4 and upsample.shape[1] == 4:', ' fade_in = EqualizedConv2D(3, ', ' kernel_size=(1,1), ', ' strides=(1,1),', ' kernel_initializer=kernel_init)(...
[{'reason_category': 'If Body', 'usage_line': 484}, {'reason_category': 'If Body', 'usage_line': 485}, {'reason_category': 'If Body', 'usage_line': 486}, {'reason_category': 'If Body', 'usage_line': 487}, {'reason_category': 'If Body', 'usage_line': 488}, {'reason_category': 'If Body', 'usage_line': 489}, {'reason_cate...
Variable 'downsample_func' used at line 484 is defined at line 468 and has a Medium-Range dependency. Variable 'inputs' used at line 484 is defined at line 475 and has a Short-Range dependency. Variable 'act_func' used at line 486 is defined at line 467 and has a Medium-Range dependency. Class 'EqualizedConv2D' used at...
{'If Body': 10}
{'Variable Medium-Range': 6, 'Variable Short-Range': 6, 'Class Long-Range': 1}
completion_python
GAN_model
491
493
['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...
[' fade_in = (1-alpha)*h+alpha*x', ' w, _ = center(fade_in)', ' x = x+w']
['', ' x,upsample = bottom(x)', ' ', ' if x.shape[1] == 4 and upsample.shape[1] == 4:', ' fade_in = EqualizedConv2D(3, ', ' kernel_size=(1,1), ', ' strides=(1,1),', ' kernel_initializer=kernel_init)(...
[{'reason_category': 'If Body', 'usage_line': 491}, {'reason_category': 'If Body', 'usage_line': 492}, {'reason_category': 'If Body', 'usage_line': 493}]
Variable 'alpha' used at line 491 is defined at line 476 and has a Medium-Range dependency. Variable 'h' used at line 491 is defined at line 486 and has a Short-Range dependency. Variable 'x' used at line 491 is defined at line 482 and has a Short-Range dependency. Variable 'center' used at line 492 is defined at line ...
{'If Body': 3}
{'Variable Medium-Range': 2, 'Variable Short-Range': 4}
completion_python
GAN_model
493
493
['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 = x+w']
['', ' x,upsample = bottom(x)', ' ', ' if x.shape[1] == 4 and upsample.shape[1] == 4:', ' fade_in = EqualizedConv2D(3, ', ' kernel_size=(1,1), ', ' strides=(1,1),', ' kernel_initializer=kernel_init)(...
[{'reason_category': 'If Body', 'usage_line': 493}]
Variable 'w' used at line 493 is defined at line 492 and has a Short-Range dependency.
{'If Body': 1}
{'Variable Short-Range': 1}
completion_python
GAN_model
498
503
['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...
[' fade_in = EqualizedConv2D(3, ', ' kernel_size=(1,1), ', ' strides=(1,1),', ' kernel_initializer=kernel_init)(x)', ' ', ' fade_in = tf.math.tanh(fade_in)']
[' else:', ' upsample = EqualizedConv2D(3, ', ' kernel_size=(1,1), ', ' strides=(1,1),', ' kernel_initializer=kernel_init)(upsample)', ' ', ' x = EqualizedConv2D(3, ', ' ...
[{'reason_category': 'If Body', 'usage_line': 498}, {'reason_category': 'If Body', 'usage_line': 499}, {'reason_category': 'If Body', 'usage_line': 500}, {'reason_category': 'If Body', 'usage_line': 501}, {'reason_category': 'If Body', 'usage_line': 502}, {'reason_category': 'If Body', 'usage_line': 503}]
Class 'EqualizedConv2D' used at line 498 is defined at line 83 and has a Long-Range dependency. Variable 'kernel_init' used at line 501 is defined at line 472 and has a Medium-Range dependency. Variable 'x' used at line 501 is defined at line 495 and has a Short-Range dependency. Library 'tf' used at line 503 is import...
{'If Body': 6}
{'Class Long-Range': 1, 'Variable Medium-Range': 1, 'Variable Short-Range': 2, 'Library Long-Range': 1}
completion_python
GAN_model
505
515
['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...
[' upsample = EqualizedConv2D(3, ', ' kernel_size=(1,1), ', ' strides=(1,1),', ' kernel_initializer=kernel_init)(upsample)', ' ', ' x = EqualizedConv2D(3, ', ' kernel_...
[' ', ' model = tf.keras.models.Model([inputs,alpha], fade_in)', '', ' return model ', '', 'top_G = U_gen_top_init_fn', 'bottom_G = U_gen_bottom_init_fn', 'center_G = None', '', 'to_rgb_fadein_list_shape_lst=[]', 'U_rgb_fadein_fn = U_rgb_fadein(top_G, center_G, bottom_G,relu, avgpooling2D, (4,4), 512,512,kern...
[{'reason_category': 'Else Reasoning', 'usage_line': 505}, {'reason_category': 'Else Reasoning', 'usage_line': 506}, {'reason_category': 'Else Reasoning', 'usage_line': 507}, {'reason_category': 'Else Reasoning', 'usage_line': 508}, {'reason_category': 'Else Reasoning', 'usage_line': 509}, {'reason_category': 'Else Rea...
Class 'EqualizedConv2D' used at line 505 is defined at line 83 and has a Long-Range dependency. Variable 'kernel_init' used at line 508 is defined at line 472 and has a Long-Range dependency. Variable 'upsample' used at line 508 is defined at line 495 and has a Medium-Range dependency. Class 'EqualizedConv2D' used at l...
{'Else Reasoning': 11}
{'Class Long-Range': 2, 'Variable Long-Range': 3, 'Variable Medium-Range': 2, 'Library Long-Range': 1, 'Variable Short-Range': 2}
completion_python
GAN_model
515
515
['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...
[' fade_in = tf.math.tanh((1-alpha)*upsample+alpha*x)']
[' ', ' model = tf.keras.models.Model([inputs,alpha], fade_in)', '', ' return model ', '', 'top_G = U_gen_top_init_fn', 'bottom_G = U_gen_bottom_init_fn', 'center_G = None', '', 'to_rgb_fadein_list_shape_lst=[]', 'U_rgb_fadein_fn = U_rgb_fadein(top_G, center_G, bottom_G,relu, avgpooling2D, (4,4), 512,512,kern...
[{'reason_category': 'Else Reasoning', 'usage_line': 515}]
Library 'tf' used at line 515 is imported at line 15 and has a Long-Range dependency. Variable 'alpha' used at line 515 is defined at line 476 and has a Long-Range dependency. Variable 'upsample' used at line 515 is defined at line 505 and has a Short-Range dependency. Variable 'x' used at line 515 is defined at line 5...
{'Else Reasoning': 1}
{'Library Long-Range': 1, 'Variable Long-Range': 1, 'Variable Short-Range': 2}
completion_python
GAN_model
517
519
['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...
[' model = tf.keras.models.Model([inputs,alpha], fade_in)', '', ' return model ']
['', 'top_G = U_gen_top_init_fn', 'bottom_G = U_gen_bottom_init_fn', 'center_G = None', '', 'to_rgb_fadein_list_shape_lst=[]', 'U_rgb_fadein_fn = U_rgb_fadein(top_G, center_G, bottom_G,relu, avgpooling2D, (4,4), 512,512,kernel_init=tf.keras.initializers.RandomNormal(mean=0.0, stddev=1.0,seed=42))', 'for layer in U_rgb_...
[]
Library 'tf' used at line 517 is imported at line 15 and has a Long-Range dependency. Variable 'inputs' used at line 517 is defined at line 475 and has a Long-Range dependency. Variable 'alpha' used at line 517 is defined at line 476 and has a Long-Range dependency. Variable 'fade_in' used at line 517 is defined at lin...
{}
{'Library Long-Range': 1, 'Variable Long-Range': 2, 'Variable Short-Range': 2}
completion_python
GAN_model
554
564
['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 = EqualizedConv2D(filters, ', ' kernel_size=(4,4), ', ' strides=(4,4),', ' kernel_initializer=kernel_init)(x)', ' ', ' ', ' x = act_func(x)', ' x = EqualizedDense(1)(x)', ' ', ' model = tf.keras.models.Model(inputs, x)', ...
['', '#instantiate the final disc blocks and print layer shapes', 'final_block_disc_layer_shape_lst = []', 'final_block_disc_fn = final_block_disc(leakyrelu, tf.keras.initializers.RandomNormal(mean=0.0, stddev=1.0,seed=42),512) ', 'for layer in final_block_disc_fn.layers:', ' final_block_disc_layer_shape_lst.append(...
[]
Class 'EqualizedConv2D' used at line 554 is defined at line 83 and has a Long-Range dependency. Variable 'filters' used at line 554 is defined at line 542 and has a Medium-Range dependency. Variable 'kernel_init' used at line 557 is defined at line 541 and has a Medium-Range dependency. Variable 'x' used at line 557 is...
{}
{'Class Long-Range': 2, 'Variable Medium-Range': 4, 'Variable Short-Range': 3, 'Variable Long-Range': 1, 'Library Long-Range': 1}
completion_python
GAN_model
560
564
['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 = act_func(x)', ' x = EqualizedDense(1)(x)', ' ', ' model = tf.keras.models.Model(inputs, x)', ' return model']
['', '#instantiate the final disc blocks and print layer shapes', 'final_block_disc_layer_shape_lst = []', 'final_block_disc_fn = final_block_disc(leakyrelu, tf.keras.initializers.RandomNormal(mean=0.0, stddev=1.0,seed=42),512) ', 'for layer in final_block_disc_fn.layers:', ' final_block_disc_layer_shape_lst.append(...
[]
Variable 'act_func' used at line 560 is defined at line 540 and has a Medium-Range dependency. Class 'EqualizedDense' used at line 561 is defined at line 202 and has a Long-Range dependency. Variable 'x' used at line 561 is defined at line 650 and has a Long-Range dependency. Library 'tf' used at line 563 is imported a...
{}
{'Variable Medium-Range': 2, 'Class Long-Range': 1, 'Variable Long-Range': 1, 'Library Long-Range': 1, 'Variable Short-Range': 2}
completion_python
GAN_model
561
564
['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 = EqualizedDense(1)(x)', ' ', ' model = tf.keras.models.Model(inputs, x)', ' return model']
['', '#instantiate the final disc blocks and print layer shapes', 'final_block_disc_layer_shape_lst = []', 'final_block_disc_fn = final_block_disc(leakyrelu, tf.keras.initializers.RandomNormal(mean=0.0, stddev=1.0,seed=42),512) ', 'for layer in final_block_disc_fn.layers:', ' final_block_disc_layer_shape_lst.append(...
[]
Class 'EqualizedDense' used at line 561 is defined at line 202 and has a Long-Range dependency. Variable 'x' used at line 561 is defined at line 650 and has a Long-Range dependency. Library 'tf' used at line 563 is imported at line 15 and has a Long-Range dependency. Variable 'inputs' used at line 563 is defined at lin...
{}
{'Class Long-Range': 1, 'Variable Long-Range': 1, 'Library Long-Range': 1, 'Variable Medium-Range': 1, 'Variable Short-Range': 2}
completion_python
GAN_model
563
564
['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...
[' model = tf.keras.models.Model(inputs, x)', ' return model']
['', '#instantiate the final disc blocks and print layer shapes', 'final_block_disc_layer_shape_lst = []', 'final_block_disc_fn = final_block_disc(leakyrelu, tf.keras.initializers.RandomNormal(mean=0.0, stddev=1.0,seed=42),512) ', 'for layer in final_block_disc_fn.layers:', ' final_block_disc_layer_shape_lst.append(...
[]
Library 'tf' used at line 563 is imported at line 15 and has a Long-Range dependency. Variable 'inputs' used at line 563 is defined at line 544 and has a Medium-Range dependency. Variable 'x' used at line 563 is defined at line 561 and has a Short-Range dependency. Variable 'model' used at line 564 is defined at line 5...
{}
{'Library Long-Range': 1, 'Variable Medium-Range': 1, 'Variable Short-Range': 2}
completion_python
GAN_model
589
602
['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...
[' inputs = layers.Input(shape = (image_shape[0],image_shape[1],filters1))', ' ', ' x = act_func(EqualizedConv2D(filters1,', ' kernel_size=(3,3), ', ' strides=(1,1),', ' kernel_initializer=kernel_init)(inputs))', '...
['', '#instantiate the additional discriminator blocks and print layer shapes', 'additional_block_disc_layer_shape_lst = []', 'additional_block_disc_fn = additional_block_disc(leakyrelu, avgpooling2D,512,512,(8,8),tf.keras.initializers.RandomNormal(mean=0.0, stddev=1.0,seed=42)) ', 'for layer in additional_block_disc_f...
[]
Library 'layers' used at line 589 is imported at line 11 and has a Long-Range dependency. Variable 'image_shape' used at line 589 is defined at line 586 and has a Short-Range dependency. Variable 'filters1' used at line 589 is defined at line 584 and has a Short-Range dependency. Variable 'act_func' used at line 591 is...
{}
{'Library Long-Range': 2, 'Variable Short-Range': 11, 'Class Long-Range': 2, 'Variable Medium-Range': 4}
completion_python
GAN_model
595
602
['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 = act_func(EqualizedConv2D(filters2, ', ' kernel_size=(3,3), ', ' strides=(1,1), ', ' kernel_initializer=kernel_init)(x))', ' x = downsample_func(x)', ' ', ' model = tf.keras.models.Model(inputs, x)', ' retu...
['', '#instantiate the additional discriminator blocks and print layer shapes', 'additional_block_disc_layer_shape_lst = []', 'additional_block_disc_fn = additional_block_disc(leakyrelu, avgpooling2D,512,512,(8,8),tf.keras.initializers.RandomNormal(mean=0.0, stddev=1.0,seed=42)) ', 'for layer in additional_block_disc_f...
[]
Variable 'act_func' used at line 595 is defined at line 582 and has a Medium-Range dependency. Class 'EqualizedConv2D' used at line 595 is defined at line 83 and has a Long-Range dependency. Variable 'filters2' used at line 595 is defined at line 585 and has a Short-Range dependency. Variable 'kernel_init' used at line...
{}
{'Variable Medium-Range': 4, 'Class Long-Range': 1, 'Variable Short-Range': 5, 'Library Long-Range': 1}
completion_python
GAN_model
599
602
['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 = downsample_func(x)', ' ', ' model = tf.keras.models.Model(inputs, x)', ' return model']
['', '#instantiate the additional discriminator blocks and print layer shapes', 'additional_block_disc_layer_shape_lst = []', 'additional_block_disc_fn = additional_block_disc(leakyrelu, avgpooling2D,512,512,(8,8),tf.keras.initializers.RandomNormal(mean=0.0, stddev=1.0,seed=42)) ', 'for layer in additional_block_disc_f...
[]
Variable 'downsample_func' used at line 599 is defined at line 583 and has a Medium-Range dependency. Variable 'x' used at line 599 is defined at line 595 and has a Short-Range dependency. Library 'tf' used at line 601 is imported at line 15 and has a Long-Range dependency. Variable 'inputs' used at line 601 is defined...
{}
{'Variable Medium-Range': 2, 'Variable Short-Range': 3, 'Library Long-Range': 1}
completion_python
GAN_model
601
602
['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...
[' model = tf.keras.models.Model(inputs, x)', ' return model']
['', '#instantiate the additional discriminator blocks and print layer shapes', 'additional_block_disc_layer_shape_lst = []', 'additional_block_disc_fn = additional_block_disc(leakyrelu, avgpooling2D,512,512,(8,8),tf.keras.initializers.RandomNormal(mean=0.0, stddev=1.0,seed=42)) ', 'for layer in additional_block_disc_f...
[]
Library 'tf' used at line 601 is imported at line 15 and has a Long-Range dependency. Variable 'inputs' used at line 601 is defined at line 589 and has a Medium-Range dependency. Variable 'x' used at line 601 is defined at line 599 and has a Short-Range dependency. Variable 'model' used at line 602 is defined at line 6...
{}
{'Library Long-Range': 1, 'Variable Medium-Range': 1, 'Variable Short-Range': 2}
completion_python
GAN_model
620
626
['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...
[' inputs = layers.Input(shape = (input_shape[0],input_shape[1],filter2))', ' ', ' x = top(inputs)', ' x = bottom(x)', ' ', ' model = tf.keras.models.Model(inputs, x)', ' return model']
['', 'bottom = final_block_disc_fn', 'top = additional_block_disc_fn', 'conn_list_shape_lst=[]', 'connect_fn = connect_model(top, bottom, (8,8), 512)', 'for layer in connect_fn.layers:', ' conn_list_shape_lst.append(layer.output_shape)', 'print(conn_list_shape_lst)', '', 'x_conn = tf.random.normal((1,8, 8, 512))', '...
[]
Library 'layers' used at line 620 is imported at line 11 and has a Long-Range dependency. Variable 'input_shape' used at line 620 is defined at line 618 and has a Short-Range dependency. Variable 'filter2' used at line 620 is defined at line 618 and has a Short-Range dependency. Variable 'top' used at line 622 is defin...
{}
{'Library Long-Range': 2, 'Variable Short-Range': 9}
completion_python
GAN_model
622
626
['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 = top(inputs)', ' x = bottom(x)', ' ', ' model = tf.keras.models.Model(inputs, x)', ' return model']
['', 'bottom = final_block_disc_fn', 'top = additional_block_disc_fn', 'conn_list_shape_lst=[]', 'connect_fn = connect_model(top, bottom, (8,8), 512)', 'for layer in connect_fn.layers:', ' conn_list_shape_lst.append(layer.output_shape)', 'print(conn_list_shape_lst)', '', 'x_conn = tf.random.normal((1,8, 8, 512))', '...
[]
Variable 'top' used at line 622 is defined at line 618 and has a Short-Range dependency. Variable 'inputs' used at line 622 is defined at line 620 and has a Short-Range dependency. Variable 'bottom' used at line 623 is defined at line 618 and has a Short-Range dependency. Variable 'x' used at line 623 is defined at lin...
{}
{'Variable Short-Range': 7, 'Library Long-Range': 1}
completion_python
GAN_model
623
626
['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 = bottom(x)', ' ', ' model = tf.keras.models.Model(inputs, x)', ' return model']
['', 'bottom = final_block_disc_fn', 'top = additional_block_disc_fn', 'conn_list_shape_lst=[]', 'connect_fn = connect_model(top, bottom, (8,8), 512)', 'for layer in connect_fn.layers:', ' conn_list_shape_lst.append(layer.output_shape)', 'print(conn_list_shape_lst)', '', 'x_conn = tf.random.normal((1,8, 8, 512))', '...
[]
Variable 'bottom' used at line 623 is defined at line 618 and has a Short-Range dependency. Variable 'x' used at line 623 is defined at line 622 and has a Short-Range dependency. Library 'tf' used at line 625 is imported at line 15 and has a Long-Range dependency. Variable 'inputs' used at line 625 is defined at line 6...
{}
{'Variable Short-Range': 5, 'Library Long-Range': 1}
completion_python
GAN_model
660
669
['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...
[' h = downsample_func(inputs)', ' ', ' h = act_func(EqualizedConv2D(filters2, ', ' kernel_size=(1,1), ', ' strides=(1,1),', ' kernel_initializer=kernel_init)(h))', '', ' fade_in = (1-alp...
[' ', ' model = tf.keras.models.Model([inputs, alpha], x)', ' return model ', '', 'top = final_block_disc(leakyrelu, tf.keras.initializers.RandomNormal(mean=0.0, stddev=1.0,seed=42),512) ', 'bottom = None', '', 'from_rgb_fadein_shape_lst=[]', 'from_rgb_fadein_fn = from_rgb_fadein(top, bottom, leakyrelu,avgpoo...
[{'reason_category': 'If Body', 'usage_line': 660}, {'reason_category': 'If Body', 'usage_line': 661}, {'reason_category': 'If Body', 'usage_line': 662}, {'reason_category': 'If Body', 'usage_line': 663}, {'reason_category': 'If Body', 'usage_line': 664}, {'reason_category': 'If Body', 'usage_line': 665}, {'reason_cate...
Variable 'downsample_func' used at line 660 is defined at line 644 and has a Medium-Range dependency. Variable 'inputs' used at line 660 is defined at line 651 and has a Short-Range dependency. Variable 'act_func' used at line 662 is defined at line 643 and has a Medium-Range dependency. Class 'EqualizedConv2D' used at...
{'If Body': 10}
{'Variable Medium-Range': 6, 'Variable Short-Range': 5, 'Class Long-Range': 1}
completion_python
GAN_model
659
672
['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...
[' if not bottom == None:', ' h = downsample_func(inputs)', ' ', ' h = act_func(EqualizedConv2D(filters2, ', ' kernel_size=(1,1), ', ' strides=(1,1),', ' kernel_initializer=kernel_init)(h))',...
['', 'top = final_block_disc(leakyrelu, tf.keras.initializers.RandomNormal(mean=0.0, stddev=1.0,seed=42),512) ', 'bottom = None', '', 'from_rgb_fadein_shape_lst=[]', 'from_rgb_fadein_fn = from_rgb_fadein(top, bottom, leakyrelu,avgpooling2D,(4,4), 512,512,tf.keras.initializers.RandomNormal(mean=0.0, stddev=1.0,seed=42))...
[{'reason_category': 'If Condition', 'usage_line': 659}, {'reason_category': 'If Body', 'usage_line': 660}, {'reason_category': 'If Body', 'usage_line': 661}, {'reason_category': 'If Body', 'usage_line': 662}, {'reason_category': 'If Body', 'usage_line': 663}, {'reason_category': 'If Body', 'usage_line': 664}, {'reason...
Variable 'bottom' used at line 659 is defined at line 642 and has a Medium-Range dependency. Variable 'downsample_func' used at line 660 is defined at line 644 and has a Medium-Range dependency. Variable 'inputs' used at line 660 is defined at line 651 and has a Short-Range dependency. Variable 'act_func' used at line ...
{'If Condition': 1, 'If Body': 10}
{'Variable Medium-Range': 9, 'Variable Short-Range': 7, 'Class Long-Range': 1, 'Library Long-Range': 1}
completion_python
GAN_model
671
672
['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...
[' model = tf.keras.models.Model([inputs, alpha], x)', ' return model ']
['', 'top = final_block_disc(leakyrelu, tf.keras.initializers.RandomNormal(mean=0.0, stddev=1.0,seed=42),512) ', 'bottom = None', '', 'from_rgb_fadein_shape_lst=[]', 'from_rgb_fadein_fn = from_rgb_fadein(top, bottom, leakyrelu,avgpooling2D,(4,4), 512,512,tf.keras.initializers.RandomNormal(mean=0.0, stddev=1.0,seed=42))...
[]
Library 'tf' used at line 671 is imported at line 15 and has a Long-Range dependency. Variable 'inputs' used at line 671 is defined at line 651 and has a Medium-Range dependency. Variable 'alpha' used at line 671 is defined at line 652 and has a Medium-Range dependency. Variable 'x' used at line 671 is defined at line ...
{}
{'Library Long-Range': 1, 'Variable Medium-Range': 2, 'Variable Short-Range': 2}
completion_python
simplex_method
4
4
['import heapq', '# Calculate the dot product of two vectors', 'def dot(a,b):']
[' return sum(x*y for x,y in zip(a,b))']
['', '# Get a specific column from a 2D list (matrix)', 'def column(A, j):', ' return [row[j] for row in A]', '', '# Transpose a 2D list (matrix)', 'def transpose(A):', ' return [column(A, j) for j in range(len(A[0]))]', '', '# Check if a column is a pivot column', 'def isPivotCol(col):', ' return (len([c for c i...
[{'reason_category': 'Generator_Expressions', 'usage_line': 4}]
Variable 'x' used at line 4 is part of a Generator_Expressions defined at line 4 and has a Short-Range dependency. Variable 'y' used at line 4 is part of a Generator_Expressions defined at line 4 and has a Short-Range dependency. Variable 'a' used at line 4 is defined at line 3 and has a Short-Range dependency. Variabl...
{'Generator_Expressions': 1}
{'Variable Generator_Expressions Short-Range': 2, 'Variable Short-Range': 2}
completion_python
simplex_method
8
8
['import heapq', '# Calculate the dot product of two vectors', 'def dot(a,b):', ' return sum(x*y for x,y in zip(a,b))', '', '# Get a specific column from a 2D list (matrix)', 'def column(A, j):']
[' return [row[j] for row in A]']
['', '# Transpose a 2D list (matrix)', 'def transpose(A):', ' return [column(A, j) for j in range(len(A[0]))]', '', '# Check if a column is a pivot column', 'def isPivotCol(col):', ' return (len([c for c in col if c == 0]) == len(col) - 1) and sum(col) == 1', '', '# Find the value of a variable for a pivot column',...
[{'reason_category': 'List_Comprehension', 'usage_line': 8}]
Variable 'row' used at line 8 is part of a List_Comprehension defined at line 8 and has a Short-Range dependency. Variable 'A' used at line 8 is defined at line 7 and has a Short-Range dependency. Variable 'j' used at line 8 is defined at line 7 and has a Short-Range dependency.
{'List_Comprehension': 1}
{'Variable List_Comprehension Short-Range': 1, 'Variable Short-Range': 2}
completion_python
simplex_method
12
12
['import heapq', '# Calculate the dot product of two vectors', 'def dot(a,b):', ' return sum(x*y for x,y in zip(a,b))', '', '# Get a specific column from a 2D list (matrix)', 'def column(A, j):', ' return [row[j] for row in A]', '', '# Transpose a 2D list (matrix)', 'def transpose(A):']
[' return [column(A, j) for j in range(len(A[0]))]']
['', '# Check if a column is a pivot column', 'def isPivotCol(col):', ' return (len([c for c in col if c == 0]) == len(col) - 1) and sum(col) == 1', '', '# Find the value of a variable for a pivot column', 'def variableValueForPivotColumn(tableau, column):', ' pivotRow = [i for (i, x) in enumerate(column) if x == 1...
[{'reason_category': 'List_Comprehension', 'usage_line': 12}]
Variable 'j' used at line 12 is part of a List_Comprehension defined at line 12 and has a Short-Range dependency. Variable 'A' used at line 12 is defined at line 11 and has a Short-Range dependency. Function 'column' used at line 12 is defined at line 7 and has a Short-Range dependency.
{'List_Comprehension': 1}
{'Variable List_Comprehension Short-Range': 1, 'Variable Short-Range': 1, 'Function Short-Range': 1}
completion_python
simplex_method
16
16
['import heapq', '# Calculate the dot product of two vectors', 'def dot(a,b):', ' return sum(x*y for x,y in zip(a,b))', '', '# Get a specific column from a 2D list (matrix)', 'def column(A, j):', ' return [row[j] for row in A]', '', '# Transpose a 2D list (matrix)', 'def transpose(A):', ' return [column(A, j) for...
[' return (len([c for c in col if c == 0]) == len(col) - 1) and sum(col) == 1']
['', '# Find the value of a variable for a pivot column', 'def variableValueForPivotColumn(tableau, column):', ' pivotRow = [i for (i, x) in enumerate(column) if x == 1][0]', ' return tableau[pivotRow][-1]', '', '# Check if we can improve the current solution', 'def canImprove(tableau):', ' lastRow = tableau[-1]'...
[{'reason_category': 'List_Comprehension', 'usage_line': 16}]
Variable 'c' used at line 16 is part of a List_Comprehension defined at line 16 and has a Short-Range dependency. Variable 'col' used at line 16 is defined at line 15 and has a Short-Range dependency.
{'List_Comprehension': 1}
{'Variable List_Comprehension Short-Range': 1, 'Variable Short-Range': 1}
completion_python
simplex_method
20
21
['import heapq', '# Calculate the dot product of two vectors', 'def dot(a,b):', ' return sum(x*y for x,y in zip(a,b))', '', '# Get a specific column from a 2D list (matrix)', 'def column(A, j):', ' return [row[j] for row in A]', '', '# Transpose a 2D list (matrix)', 'def transpose(A):', ' return [column(A, j) for...
[' pivotRow = [i for (i, x) in enumerate(column) if x == 1][0]', ' return tableau[pivotRow][-1]']
['', '# Check if we can improve the current solution', 'def canImprove(tableau):', ' lastRow = tableau[-1]', ' return any(x > 0 for x in lastRow[:-1])', '', "# Check if there's more than one minimum in a list", 'def moreThanOneMin(L):', ' if len(L) <= 1:', ' return False', ' x,y = heapq.nsmallest(2, L, key...
[{'reason_category': 'List_Comprehension', 'usage_line': 20}]
Variable 'i' used at line 20 is part of a List_Comprehension defined at line 20 and has a Short-Range dependency. Variable 'x' used at line 20 is part of a List_Comprehension defined at line 20 and has a Short-Range dependency. Variable 'column' used at line 20 is defined at line 19 and has a Short-Range dependency. Va...
{'List_Comprehension': 1}
{'Variable List_Comprehension Short-Range': 2, 'Variable Short-Range': 3}
completion_python
simplex_method
25
26
['import heapq', '# Calculate the dot product of two vectors', 'def dot(a,b):', ' return sum(x*y for x,y in zip(a,b))', '', '# Get a specific column from a 2D list (matrix)', 'def column(A, j):', ' return [row[j] for row in A]', '', '# Transpose a 2D list (matrix)', 'def transpose(A):', ' return [column(A, j) for...
[' lastRow = tableau[-1]', ' return any(x > 0 for x in lastRow[:-1])']
['', "# Check if there's more than one minimum in a list", 'def moreThanOneMin(L):', ' if len(L) <= 1:', ' return False', ' x,y = heapq.nsmallest(2, L, key=lambda x: x[1])', ' return x == y', '', '# Create an identity matrix with certain specifications', 'def identity(numRows, numCols, val=1, rowStart=0):', ...
[{'reason_category': 'Generator_Expressions', 'usage_line': 26}]
Variable 'tableau' used at line 25 is defined at line 24 and has a Short-Range dependency. Variable 'x' used at line 26 is part of a Generator_Expressions defined at line 26 and has a Short-Range dependency. Variable 'lastRow' used at line 26 is defined at line 25 and has a Short-Range dependency.
{'Generator_Expressions': 1}
{'Variable Short-Range': 2, 'Variable Generator_Expressions Short-Range': 1}
completion_python
simplex_method
30
33
['import heapq', '# Calculate the dot product of two vectors', 'def dot(a,b):', ' return sum(x*y for x,y in zip(a,b))', '', '# Get a specific column from a 2D list (matrix)', 'def column(A, j):', ' return [row[j] for row in A]', '', '# Transpose a 2D list (matrix)', 'def transpose(A):', ' return [column(A, j) for...
[' if len(L) <= 1:', ' return False', ' x,y = heapq.nsmallest(2, L, key=lambda x: x[1])', ' return x == y']
['', '# Create an identity matrix with certain specifications', 'def identity(numRows, numCols, val=1, rowStart=0):', ' return [[(val if i == j else 0) for j in range(numCols)] for i in range(rowStart, numRows)] ', '', 'def standardForm(cost, greaterThans=[], gtThreshold=[], lessThans=[], ltThreshold=[], equalities=[...
[{'reason_category': 'If Condition', 'usage_line': 30}, {'reason_category': 'If Body', 'usage_line': 31}, {'reason_category': 'Lambda_Expressions', 'usage_line': 32}]
Variable 'L' used at line 30 is defined at line 29 and has a Short-Range dependency. Library 'heapq' used at line 32 is imported at line 1 and has a Long-Range dependency. Variable 'L' used at line 32 is defined at line 29 and has a Short-Range dependency. Variable 'x' used at line 32 is part of a Lambda_Expressions de...
{'If Condition': 1, 'If Body': 1, 'Lambda_Expressions': 1}
{'Variable Short-Range': 4, 'Library Long-Range': 1, 'Variable Lambda_Expressions Short-Range': 1}
completion_python
simplex_method
31
31
['import heapq', '# Calculate the dot product of two vectors', 'def dot(a,b):', ' return sum(x*y for x,y in zip(a,b))', '', '# Get a specific column from a 2D list (matrix)', 'def column(A, j):', ' return [row[j] for row in A]', '', '# Transpose a 2D list (matrix)', 'def transpose(A):', ' return [column(A, j) for...
[' return False']
[' x,y = heapq.nsmallest(2, L, key=lambda x: x[1])', ' return x == y', '', '# Create an identity matrix with certain specifications', 'def identity(numRows, numCols, val=1, rowStart=0):', ' return [[(val if i == j else 0) for j in range(numCols)] for i in range(rowStart, numRows)] ', '', 'def standardForm(cost, g...
[{'reason_category': 'If Body', 'usage_line': 31}]
null
{'If Body': 1}
null
completion_python
simplex_method
47
48
['import heapq', '# Calculate the dot product of two vectors', 'def dot(a,b):', ' return sum(x*y for x,y in zip(a,b))', '', '# Get a specific column from a 2D list (matrix)', 'def column(A, j):', ' return [row[j] for row in A]', '', '# Transpose a 2D list (matrix)', 'def transpose(A):', ' return [column(A, j) for...
[' newVars += len(gtThreshold)', ' numRows += len(gtThreshold)']
['', ' if ltThreshold != []:', ' newVars += len(ltThreshold)', ' numRows += len(ltThreshold)', ' ', " # Equalities don't need slack variables but add to the number of rows", ' if eqThreshold != []:', ' numRows += len(eqThreshold)', '', ' # If the problem is a minimization, convert it to a maxim...
[{'reason_category': 'If Body', 'usage_line': 47}, {'reason_category': 'If Body', 'usage_line': 48}]
Variable 'newVars' used at line 47 is defined at line 41 and has a Short-Range dependency. Variable 'gtThreshold' used at line 47 is defined at line 39 and has a Short-Range dependency. Variable 'numRows' used at line 48 is defined at line 42 and has a Short-Range dependency. Variable 'gtThreshold' used at line 48 is d...
{'If Body': 2}
{'Variable Short-Range': 4}
completion_python
simplex_method
51
52
['import heapq', '# Calculate the dot product of two vectors', 'def dot(a,b):', ' return sum(x*y for x,y in zip(a,b))', '', '# Get a specific column from a 2D list (matrix)', 'def column(A, j):', ' return [row[j] for row in A]', '', '# Transpose a 2D list (matrix)', 'def transpose(A):', ' return [column(A, j) for...
[' newVars += len(ltThreshold)', ' numRows += len(ltThreshold)']
[' ', " # Equalities don't need slack variables but add to the number of rows", ' if eqThreshold != []:', ' numRows += len(eqThreshold)', '', ' # If the problem is a minimization, convert it to a maximization by negating the cost vector ', ' if not maximization:', ' cost = [-x for x in cost]', '',...
[{'reason_category': 'If Body', 'usage_line': 51}, {'reason_category': 'If Body', 'usage_line': 52}]
Variable 'newVars' used at line 51 is defined at line 41 and has a Short-Range dependency. Variable 'ltThreshold' used at line 51 is defined at line 39 and has a Medium-Range dependency. Variable 'numRows' used at line 52 is defined at line 42 and has a Short-Range dependency. Variable 'ltThreshold' used at line 52 is ...
{'If Body': 2}
{'Variable Short-Range': 2, 'Variable Medium-Range': 2}
completion_python
simplex_method
56
56
['import heapq', '# Calculate the dot product of two vectors', 'def dot(a,b):', ' return sum(x*y for x,y in zip(a,b))', '', '# Get a specific column from a 2D list (matrix)', 'def column(A, j):', ' return [row[j] for row in A]', '', '# Transpose a 2D list (matrix)', 'def transpose(A):', ' return [column(A, j) for...
[' numRows += len(eqThreshold)']
['', ' # If the problem is a minimization, convert it to a maximization by negating the cost vector ', ' if not maximization:', ' cost = [-x for x in cost]', '', ' # If no new variables are needed, the problem is already in standard form', ' if newVars == 0:', ' return cost, equalities, eqThreshold'...
[{'reason_category': 'If Body', 'usage_line': 56}]
Variable 'numRows' used at line 56 is defined at line 42 and has a Medium-Range dependency. Variable 'eqThreshold' used at line 56 is defined at line 39 and has a Medium-Range dependency.
{'If Body': 1}
{'Variable Medium-Range': 2}
completion_python
simplex_method
60
60
['import heapq', '# Calculate the dot product of two vectors', 'def dot(a,b):', ' return sum(x*y for x,y in zip(a,b))', '', '# Get a specific column from a 2D list (matrix)', 'def column(A, j):', ' return [row[j] for row in A]', '', '# Transpose a 2D list (matrix)', 'def transpose(A):', ' return [column(A, j) for...
[' cost = [-x for x in cost]']
['', ' # If no new variables are needed, the problem is already in standard form', ' if newVars == 0:', ' return cost, equalities, eqThreshold', '', ' # Extend the cost function with zeros for the new slack variables', ' newCost = list(cost) + [0] * newVars', ' constraints = []', ' threshold = []', '',...
[{'reason_category': 'If Body', 'usage_line': 60}, {'reason_category': 'List_Comprehension', 'usage_line': 60}]
Variable 'x' used at line 60 is part of a List_Comprehension defined at line 60 and has a Short-Range dependency. Variable 'cost' used at line 60 is defined at line 39 and has a Medium-Range dependency.
{'If Body': 1, 'List_Comprehension': 1}
{'Variable List_Comprehension Short-Range': 1, 'Variable Medium-Range': 1}
completion_python
simplex_method
64
64
['import heapq', '# Calculate the dot product of two vectors', 'def dot(a,b):', ' return sum(x*y for x,y in zip(a,b))', '', '# Get a specific column from a 2D list (matrix)', 'def column(A, j):', ' return [row[j] for row in A]', '', '# Transpose a 2D list (matrix)', 'def transpose(A):', ' return [column(A, j) for...
[' return cost, equalities, eqThreshold']
['', ' # Extend the cost function with zeros for the new slack variables', ' newCost = list(cost) + [0] * newVars', ' constraints = []', ' threshold = []', '', " # Prepare the constraints for each condition ('greater than', 'less than', 'equal to')", ' oldConstraints = [(greaterThans, gtThreshold, -1), (les...
[{'reason_category': 'If Body', 'usage_line': 64}]
Variable 'cost' used at line 64 is defined at line 39 and has a Medium-Range dependency. Variable 'equalities' used at line 64 is defined at line 39 and has a Medium-Range dependency. Variable 'eqThreshold' used at line 64 is defined at line 39 and has a Medium-Range dependency.
{'If Body': 1}
{'Variable Medium-Range': 3}
completion_python
simplex_method
78
82
['import heapq', '# Calculate the dot product of two vectors', 'def dot(a,b):', ' return sum(x*y for x,y in zip(a,b))', '', '# Get a specific column from a 2D list (matrix)', 'def column(A, j):', ' return [row[j] for row in A]', '', '# Transpose a 2D list (matrix)', 'def transpose(A):', ' return [column(A, j) for...
[' constraints += [c + r for c, r in zip(constraintList, identity(numRows, newVars, coefficient, offset))]', ' # Append the thresholds for each constraint', ' threshold += oldThreshold', ' # Increase the offset for the identity matrix used for the next set of constraints', ' offset += len(oldTh...
['', ' return newCost, constraints, threshold', '', "'''", ' simplex: [float], [[float]], [float] -> [float], float', ' Solve the given standard-form linear program:', ' max <c,x>', ' s.t. Ax = b', ' x >= 0', ' providing the optimal solution x* and the value of the objective function', "'''"...
[{'reason_category': 'Loop Body', 'usage_line': 78}, {'reason_category': 'List_Comprehension', 'usage_line': 78}, {'reason_category': 'Loop Body', 'usage_line': 79}, {'reason_category': 'Loop Body', 'usage_line': 80}, {'reason_category': 'Loop Body', 'usage_line': 81}, {'reason_category': 'Loop Body', 'usage_line': 82}...
Variable 'constraints' used at line 78 is defined at line 68 and has a Short-Range dependency. Variable 'c' used at line 78 is part of a List_Comprehension defined at line 78 and has a Short-Range dependency. Variable 'r' used at line 78 is part of a List_Comprehension defined at line 78 and has a Short-Range dependenc...
{'Loop Body': 5, 'List_Comprehension': 1}
{'Variable Short-Range': 3, 'Variable List_Comprehension Short-Range': 2, 'Variable Loop Short-Range': 4, 'Function Long-Range': 1, 'Variable Long-Range': 2, 'Variable Medium-Range': 1}
completion_python
simplex_method
134
136
['import heapq', '# Calculate the dot product of two vectors', 'def dot(a,b):', ' return sum(x*y for x,y in zip(a,b))', '', '# Get a specific column from a 2D list (matrix)', 'def column(A, j):', ' return [row[j] for row in A]', '', '# Transpose a 2D list (matrix)', 'def transpose(A):', ' return [column(A, j) for...
[' if k != i:', ' pivotRowMultiple = [y * tableau[k][j] for y in tableau[i]]', ' tableau[k] = [x - y for x,y in zip(tableau[k], pivotRowMultiple)]']
[' print("Tableau after pivot:")', ' for row in tableau:', ' print(row)', ' print()', ' ', ' # Transpose the tableau to make it easier to work with columns', ' columns = transpose(tableau)', '', ' # Identify pivot columns in the tableau. A column is a pivot column if it has a single 1 and...
[{'reason_category': 'Loop Body', 'usage_line': 134}, {'reason_category': 'If Condition', 'usage_line': 134}, {'reason_category': 'Loop Body', 'usage_line': 135}, {'reason_category': 'List_Comprehension', 'usage_line': 135}, {'reason_category': 'If Body', 'usage_line': 135}, {'reason_category': 'Loop Body', 'usage_line...
Variable 'k' used at line 134 is part of a Loop defined at line 133 and has a Short-Range dependency. Variable 'i' used at line 134 is defined at line 126 and has a Short-Range dependency. Variable 'y' used at line 135 is part of a List_Comprehension defined at line 135 and has a Short-Range dependency. Variable 'table...
{'Loop Body': 3, 'If Condition': 1, 'List_Comprehension': 2, 'If Body': 2}
{'Variable Loop Short-Range': 3, 'Variable Short-Range': 6, 'Variable List_Comprehension Short-Range': 3}
completion_python
simplex_method
135
136
['import heapq', '# Calculate the dot product of two vectors', 'def dot(a,b):', ' return sum(x*y for x,y in zip(a,b))', '', '# Get a specific column from a 2D list (matrix)', 'def column(A, j):', ' return [row[j] for row in A]', '', '# Transpose a 2D list (matrix)', 'def transpose(A):', ' return [column(A, j) for...
[' pivotRowMultiple = [y * tableau[k][j] for y in tableau[i]]', ' tableau[k] = [x - y for x,y in zip(tableau[k], pivotRowMultiple)]']
[' print("Tableau after pivot:")', ' for row in tableau:', ' print(row)', ' print()', ' ', ' # Transpose the tableau to make it easier to work with columns', ' columns = transpose(tableau)', '', ' # Identify pivot columns in the tableau. A column is a pivot column if it has a single 1 and...
[{'reason_category': 'Loop Body', 'usage_line': 135}, {'reason_category': 'List_Comprehension', 'usage_line': 135}, {'reason_category': 'If Body', 'usage_line': 135}, {'reason_category': 'Loop Body', 'usage_line': 136}, {'reason_category': 'List_Comprehension', 'usage_line': 136}, {'reason_category': 'If Body', 'usage_...
Variable 'y' used at line 135 is part of a List_Comprehension defined at line 135 and has a Short-Range dependency. Variable 'tableau' used at line 135 is defined at line 130 and has a Short-Range dependency. Variable 'i' used at line 135 is defined at line 126 and has a Short-Range dependency. Variable 'k' used at lin...
{'Loop Body': 2, 'List_Comprehension': 2, 'If Body': 2}
{'Variable List_Comprehension Short-Range': 3, 'Variable Short-Range': 5, 'Variable Loop Short-Range': 2}
completion_python
simplex_method
149
154
['import heapq', '# Calculate the dot product of two vectors', 'def dot(a,b):', ' return sum(x*y for x,y in zip(a,b))', '', '# Get a specific column from a 2D list (matrix)', 'def column(A, j):', ' return [row[j] for row in A]', '', '# Transpose a 2D list (matrix)', 'def transpose(A):', ' return [column(A, j) for...
[' primal_solution = [(colIndex, variableValueForPivotColumn(tableau, columns[colIndex])) for colIndex in indices]', ' ', ' # The last entry of the last row of the tableau gives us the negation of the objective function value.', ' objective_value = -(tableau[-1][-1])', '', ' return tableau, primal_solution, o...
[]
[{'reason_category': 'List_Comprehension', 'usage_line': 149}]
Variable 'colIndex' used at line 149 is part of a List_Comprehension defined at line 149 and has a Short-Range dependency. Variable 'indices' used at line 149 is defined at line 146 and has a Short-Range dependency. Function 'variableValueForPivotColumn' used at line 149 is defined at line 19 and has a Long-Range depen...
{'List_Comprehension': 1}
{'Variable List_Comprehension Short-Range': 1, 'Variable Short-Range': 4, 'Function Long-Range': 1, 'Variable Long-Range': 3}
completion_python
RL_Motion_Planning
83
84
['import os', "os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' # Suppress TensorFlow logging", "os.environ['TF_ENABLE_ONEDNN_OPTS'] = '0' # Suppress oneDNN warning", '# os.environ["CUDA_VISIBLE_DEVICES"] = "0"', 'import argparse', 'import datetime', 'import json', 'import os', 'import pickle', 'import sys', 'import time', '...
[' goals = tf.map_fn(lambda x: x[3: 3 + num_objs * 3], states, fn_output_signature=tf.float32)', ' return goals']
[' ', ' return get_goal', '', '', 'def repurpose_skill_seq(args, skill_seq):', ' """', ' Repurpose the skill sequence to be used for training the policy. Use value of wrap_skill_id', ' = "0": no change', ' = "1": wrap pick/grab/drop:obj_id to pick/grab/drop', ' = "2": wrap pick:obj_id to pick/grab/...
[{'reason_category': 'Lambda_Expressions', 'usage_line': 83}]
Library 'tf' used at line 83 is imported at line 20 and has a Long-Range dependency. Variable 'x' used at line 83 is part of a Lambda_Expressions defined at line 83 and has a Short-Range dependency. Variable 'num_objs' used at line 83 is defined at line 74 and has a Short-Range dependency. Variable 'states' used at lin...
{'Lambda_Expressions': 1}
{'Library Long-Range': 1, 'Variable Lambda_Expressions Short-Range': 1, 'Variable Short-Range': 3}
completion_python
RL_Motion_Planning
81
86
['import os', "os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' # Suppress TensorFlow logging", "os.environ['TF_ENABLE_ONEDNN_OPTS'] = '0' # Suppress oneDNN warning", '# os.environ["CUDA_VISIBLE_DEVICES"] = "0"', 'import argparse', 'import datetime', 'import json', 'import os', 'import pickle', 'import sys', 'import time', '...
[' def get_goal(states: tf.Tensor, obj_identifiers: tf.Tensor = None):', ' # Get achieved goals', ' goals = tf.map_fn(lambda x: x[3: 3 + num_objs * 3], states, fn_output_signature=tf.float32)', ' return goals', ' ', ' return get_goal']
['', '', 'def repurpose_skill_seq(args, skill_seq):', ' """', ' Repurpose the skill sequence to be used for training the policy. Use value of wrap_skill_id', ' = "0": no change', ' = "1": wrap pick/grab/drop:obj_id to pick/grab/drop', ' = "2": wrap pick:obj_id to pick/grab/drop:obj_id to obj_id', ' :p...
[{'reason_category': 'Lambda_Expressions', 'usage_line': 83}]
Library 'tf' used at line 81 is imported at line 20 and has a Long-Range dependency. Library 'tf' used at line 83 is imported at line 20 and has a Long-Range dependency. Variable 'x' used at line 83 is part of a Lambda_Expressions defined at line 83 and has a Short-Range dependency. Variable 'num_objs' used at line 83 ...
{'Lambda_Expressions': 1}
{'Library Long-Range': 2, 'Variable Lambda_Expressions Short-Range': 1, 'Variable Short-Range': 3, 'Function Short-Range': 1}
completion_python
RL_Motion_Planning
103
103
['import os', "os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' # Suppress TensorFlow logging", "os.environ['TF_ENABLE_ONEDNN_OPTS'] = '0' # Suppress oneDNN warning", '# os.environ["CUDA_VISIBLE_DEVICES"] = "0"', 'import argparse', 'import datetime', 'import json', 'import os', 'import pickle', 'import sys', 'import time', '...
[' return skill_seq']
[' elif args.wrap_level == "1":', ' # wrap by i = j % 3 where i is the new position of skill originally at j. Dim changes from c_dim to 3', ' skill_seq = tf.argmax(skill_seq, axis=-1)', ' skill_seq = skill_seq % 3', ' # Convert back to one-hot', ' skill_seq = tf.one_hot(skill_seq, ...
[{'reason_category': 'If Body', 'usage_line': 103}]
Variable 'skill_seq' used at line 103 is defined at line 89 and has a Medium-Range dependency.
{'If Body': 1}
{'Variable Medium-Range': 1}
completion_python
RL_Motion_Planning
106
110
['import os', "os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' # Suppress TensorFlow logging", "os.environ['TF_ENABLE_ONEDNN_OPTS'] = '0' # Suppress oneDNN warning", '# os.environ["CUDA_VISIBLE_DEVICES"] = "0"', 'import argparse', 'import datetime', 'import json', 'import os', 'import pickle', 'import sys', 'import time', '...
[' skill_seq = tf.argmax(skill_seq, axis=-1)', ' skill_seq = skill_seq % 3', ' # Convert back to one-hot', ' skill_seq = tf.one_hot(skill_seq, depth=3)', ' return skill_seq']
[' elif args.wrap_level == "2":', ' # wrap such that 0/1/2 -> 0, 3/4/5 -> 1, 6/7/8 -> 2 ... Dim changes from c_dim to self.args.num_objs', ' skill_seq = tf.argmax(skill_seq, axis=-1)', ' skill_seq = skill_seq // 3', ' # Convert back to one-hot', ' skill_seq = tf.one_hot(skill_seq, ...
[{'reason_category': 'Elif Body', 'usage_line': 106}, {'reason_category': 'Elif Body', 'usage_line': 107}, {'reason_category': 'Elif Body', 'usage_line': 108}, {'reason_category': 'Elif Body', 'usage_line': 109}, {'reason_category': 'Elif Body', 'usage_line': 110}]
Library 'tf' used at line 106 is imported at line 20 and has a Long-Range dependency. Variable 'skill_seq' used at line 106 is defined at line 89 and has a Medium-Range dependency. Variable 'skill_seq' used at line 107 is defined at line 106 and has a Short-Range dependency. Variable 'skill_seq' used at line 109 is def...
{'Elif Body': 5}
{'Library Long-Range': 2, 'Variable Medium-Range': 1, 'Variable Short-Range': 3}
completion_python
RL_Motion_Planning
135
136
['import os', "os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' # Suppress TensorFlow logging", "os.environ['TF_ENABLE_ONEDNN_OPTS'] = '0' # Suppress oneDNN warning", '# os.environ["CUDA_VISIBLE_DEVICES"] = "0"', 'import argparse', 'import datetime', 'import json', 'import os', 'import pickle', 'import sys', 'import time', '...
[' prod = tf.matmul(tf.transpose(layer.kernel), layer.kernel)', ' reg += tf.reduce_sum(tf.math.square(prod * (1 - tf.eye(prod.shape[0]))))']
[' ', ' print("Orthogonal Regularization: {}".format(reg * reg_coef))', ' return reg * reg_coef', '', '', 'def sample_transitions(sample_style: str, state_to_goal=None, num_options: int = None):', ' def sample_random_transitions(episodic_data, batch_size_in_transitions=None):', ' """', ' Sampl...
[{'reason_category': 'Loop Body', 'usage_line': 135}, {'reason_category': 'If Body', 'usage_line': 135}, {'reason_category': 'Loop Body', 'usage_line': 136}, {'reason_category': 'If Body', 'usage_line': 136}]
Library 'tf' used at line 135 is imported at line 20 and has a Long-Range dependency. Variable 'layer' used at line 135 is part of a Loop defined at line 133 and has a Short-Range dependency. Variable 'reg' used at line 136 is defined at line 132 and has a Short-Range dependency. Library 'tf' used at line 136 is import...
{'Loop Body': 2, 'If Body': 2}
{'Library Long-Range': 2, 'Variable Loop Short-Range': 1, 'Variable Short-Range': 2}
completion_python
RL_Motion_Planning
139
139
['import os', "os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' # Suppress TensorFlow logging", "os.environ['TF_ENABLE_ONEDNN_OPTS'] = '0' # Suppress oneDNN warning", '# os.environ["CUDA_VISIBLE_DEVICES"] = "0"', 'import argparse', 'import datetime', 'import json', 'import os', 'import pickle', 'import sys', 'import time', '...
[' return reg * reg_coef']
['', '', 'def sample_transitions(sample_style: str, state_to_goal=None, num_options: int = None):', ' def sample_random_transitions(episodic_data, batch_size_in_transitions=None):', ' """', ' Sample random transitions without HER.', ' Functionality: Sample random time-steps from each episode: (g...
[]
Variable 'reg' used at line 139 is defined at line 132 and has a Short-Range dependency. Variable 'reg_coef' used at line 139 is defined at line 122 and has a Medium-Range dependency.
{}
{'Variable Short-Range': 1, 'Variable Medium-Range': 1}
completion_python
RL_Motion_Planning
193
193
['import os', "os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' # Suppress TensorFlow logging", "os.environ['TF_ENABLE_ONEDNN_OPTS'] = '0' # Suppress oneDNN warning", '# os.environ["CUDA_VISIBLE_DEVICES"] = "0"', 'import argparse', 'import datetime', 'import json', 'import os', 'import pickle', 'import sys', 'import time', '...
[' transitions[key] = tf.gather_nd(episodic_data[key], indices=curr_indices)']
[' ', " transitions['achieved_goals'] = state_to_goal(", " states=tf.gather_nd(episodic_data['states'], indices=curr_indices),", ' obj_identifiers=None)', ' ', ' # --------------- 4) Select the batch of transitions corresponding to the future time steps ------------', '...
[{'reason_category': 'Loop Body', 'usage_line': 193}]
Variable 'transitions' used at line 193 is defined at line 191 and has a Short-Range dependency. Variable 'key' used at line 193 is part of a Loop defined at line 192 and has a Short-Range dependency. Library 'tf' used at line 193 is imported at line 20 and has a Long-Range dependency. Variable 'episodic_data' used at ...
{'Loop Body': 1}
{'Variable Short-Range': 2, 'Variable Loop Short-Range': 1, 'Library Long-Range': 1, 'Variable Long-Range': 1}
completion_python
RL_Motion_Planning
211
211
['import os', "os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' # Suppress TensorFlow logging", "os.environ['TF_ENABLE_ONEDNN_OPTS'] = '0' # Suppress oneDNN warning", '# os.environ["CUDA_VISIBLE_DEVICES"] = "0"', 'import argparse', 'import datetime', 'import json', 'import os', 'import pickle', 'import sys', 'import time', '...
[' return sample_random_transitions']
[' else:', ' raise NotImplementedError', '', '', 'class ReplayBufferTf:', ' def __init__(self, buffer_shapes: Dict[str, Tuple[int, ...]], size_in_transitions, T, transition_fn=None):', ' """Creates a replay buffer.', '', ' Args:', ' buffer_shapes (dict of ints): the shape for all b...
[{'reason_category': 'If Body', 'usage_line': 211}]
Function 'sample_random_transitions' used at line 211 is defined at line 143 and has a Long-Range dependency.
{'If Body': 1}
{'Function Long-Range': 1}
completion_python
RL_Motion_Planning
244
244
['import os', "os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' # Suppress TensorFlow logging", "os.environ['TF_ENABLE_ONEDNN_OPTS'] = '0' # Suppress oneDNN warning", '# os.environ["CUDA_VISIBLE_DEVICES"] = "0"', 'import argparse', 'import datetime', 'import json', 'import os', 'import pickle', 'import sys', 'import time', '...
[' buffered_data[key] = _data[index]']
[' ', ' transitions = self.transition_fn(buffered_data, batch_size)', ' print("transitions: ", transitions)', ' return transitions', ' ', ' @tf.function', ' def sample_episodes(self, ep_start: int = None, ep_end: int = None, num_episodes: int = None):', ' ', ' if ep_st...
[{'reason_category': 'Loop Body', 'usage_line': 244}]
Variable 'buffered_data' used at line 244 is defined at line 241 and has a Short-Range dependency. Variable 'key' used at line 244 is part of a Loop defined at line 243 and has a Short-Range dependency. Variable '_data' used at line 244 is defined at line 242 and has a Short-Range dependency. Variable 'index' used at l...
{'Loop Body': 1}
{'Variable Short-Range': 2, 'Variable Loop Short-Range': 2}
completion_python
RL_Motion_Planning
246
248
['import os', "os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' # Suppress TensorFlow logging", "os.environ['TF_ENABLE_ONEDNN_OPTS'] = '0' # Suppress oneDNN warning", '# os.environ["CUDA_VISIBLE_DEVICES"] = "0"', 'import argparse', 'import datetime', 'import json', 'import os', 'import pickle', 'import sys', 'import time', '...
[' transitions = self.transition_fn(buffered_data, batch_size)', ' print("transitions: ", transitions)', ' return transitions']
[' ', ' @tf.function', ' def sample_episodes(self, ep_start: int = None, ep_end: int = None, num_episodes: int = None):', ' ', ' if ep_start is None or ep_end is None:', ' if num_episodes:', ' num_episodes = tf.math.minimum(tf.cast(num_episodes, dtype=self.current_size.d...
[]
Variable 'self' used at line 246 is defined at line 239 and has a Short-Range dependency. Variable 'buffered_data' used at line 246 is defined at line 241 and has a Short-Range dependency. Variable 'batch_size' used at line 246 is defined at line 239 and has a Short-Range dependency. Variable 'transitions' used at line...
{}
{'Variable Short-Range': 5}
completion_python
RL_Motion_Planning
255
255
['import os', "os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' # Suppress TensorFlow logging", "os.environ['TF_ENABLE_ONEDNN_OPTS'] = '0' # Suppress oneDNN warning", '# os.environ["CUDA_VISIBLE_DEVICES"] = "0"', 'import argparse', 'import datetime', 'import json', 'import os', 'import pickle', 'import sys', 'import time', '...
[' num_episodes = tf.math.minimum(tf.cast(num_episodes, dtype=self.current_size.dtype), self.current_size)']
[' else:', ' num_episodes = self.current_size', ' ep_range = tf.range(num_episodes)', ' else:', ' ep_range = tf.range(ep_start, ep_end)', ' ', ' buffered_data = {}', ' _data = self.table.read(rows=ep_range)', ' for index, key in enumerat...
[{'reason_category': 'If Body', 'usage_line': 255}]
Library 'tf' used at line 255 is imported at line 20 and has a Long-Range dependency. Variable 'self' used at line 255 is defined at line 251 and has a Short-Range dependency.
{'If Body': 1}
{'Library Long-Range': 1, 'Variable Short-Range': 1}
completion_python
RL_Motion_Planning
257
257
['import os', "os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' # Suppress TensorFlow logging", "os.environ['TF_ENABLE_ONEDNN_OPTS'] = '0' # Suppress oneDNN warning", '# os.environ["CUDA_VISIBLE_DEVICES"] = "0"', 'import argparse', 'import datetime', 'import json', 'import os', 'import pickle', 'import sys', 'import time', '...
[' num_episodes = self.current_size']
[' ep_range = tf.range(num_episodes)', ' else:', ' ep_range = tf.range(ep_start, ep_end)', ' ', ' buffered_data = {}', ' _data = self.table.read(rows=ep_range)', ' for index, key in enumerate(self.buffer_keys):', ' buffered_data[key] = _data[index]', '...
[{'reason_category': 'If Body', 'usage_line': 257}, {'reason_category': 'Else Reasoning', 'usage_line': 257}]
Variable 'self' used at line 257 is defined at line 251 and has a Short-Range dependency.
{'If Body': 1, 'Else Reasoning': 1}
{'Variable Short-Range': 1}
completion_python
RL_Motion_Planning
254
258
['import os', "os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' # Suppress TensorFlow logging", "os.environ['TF_ENABLE_ONEDNN_OPTS'] = '0' # Suppress oneDNN warning", '# os.environ["CUDA_VISIBLE_DEVICES"] = "0"', 'import argparse', 'import datetime', 'import json', 'import os', 'import pickle', 'import sys', 'import time', '...
[' if num_episodes:', ' num_episodes = tf.math.minimum(tf.cast(num_episodes, dtype=self.current_size.dtype), self.current_size)', ' else:', ' num_episodes = self.current_size', ' ep_range = tf.range(num_episodes)']
[' else:', ' ep_range = tf.range(ep_start, ep_end)', ' ', ' buffered_data = {}', ' _data = self.table.read(rows=ep_range)', ' for index, key in enumerate(self.buffer_keys):', ' buffered_data[key] = _data[index]', ' print("buffered_data: ", buffered_data)',...
[{'reason_category': 'If Body', 'usage_line': 254}, {'reason_category': 'If Condition', 'usage_line': 254}, {'reason_category': 'If Body', 'usage_line': 255}, {'reason_category': 'If Body', 'usage_line': 256}, {'reason_category': 'Else Reasoning', 'usage_line': 256}, {'reason_category': 'If Body', 'usage_line': 257}, {...
Variable 'num_episodes' used at line 254 is defined at line 251 and has a Short-Range dependency. Library 'tf' used at line 255 is imported at line 20 and has a Long-Range dependency. Variable 'self' used at line 255 is defined at line 251 and has a Short-Range dependency. Variable 'self' used at line 257 is defined at...
{'If Body': 5, 'If Condition': 1, 'Else Reasoning': 2}
{'Variable Short-Range': 4, 'Library Long-Range': 2}