pylint edits

This commit is contained in:
npapernot 2019-03-18 16:42:59 +00:00
parent ec2204ac97
commit 4784b0f31e

View file

@ -107,7 +107,7 @@ def image_whitening(data):
data[i, :, :, :] -= mean[i] * ones
# Compute adjusted standard variance
adj_std_var = np.maximum(np.ones(len(data), dtype=np.float32) / math.sqrt(nb_pixels), np.std(data, axis=(1,2,3))) #NOLINT(long-line)
adj_std_var = np.maximum(np.ones(len(data), dtype=np.float32) / math.sqrt(nb_pixels), np.std(data, axis=(1, 2, 3))) # pylint: disable=line-too-long
# Divide image
for i in xrange(len(data)):
@ -148,15 +148,15 @@ def extract_svhn(local_url):
return data, labels
def unpickle_cifar_dic(file):
def unpickle_cifar_dic(file): # pylint: disable=redefined-builtin
"""
Helper function: unpickles a dictionary (used for loading CIFAR)
:param file: filename of the pickle
:return: tuple of (images, labels)
"""
fo = open(file, 'rb')
data_dict = pickle.load(fo)
fo.close()
file_obj = open(file, 'rb')
data_dict = pickle.load(file_obj)
file_obj.close()
return data_dict['data'], data_dict['labels']
@ -176,8 +176,8 @@ def extract_cifar10(local_url, data_dir):
'/cifar10_test_labels.npy']
all_preprocessed = True
for file in preprocessed_files:
if not tf.gfile.Exists(data_dir + file):
for file_name in preprocessed_files:
if not tf.gfile.Exists(data_dir + file_name):
all_preprocessed = False
break