Skip to content

Commit e849362

Browse files
committed
Remove the overfix of print function in dataset/ folder
1 parent 4bf3c8c commit e849362

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

python/paddle/dataset/common.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,13 @@ def download(url, module_name, md5sum, save_name=None):
7474
retry_limit = 3
7575
while not (os.path.exists(filename) and md5file(filename) == md5sum):
7676
if os.path.exists(filename):
77-
print(("file md5", md5file(filename), md5sum))
77+
print("file md5", md5file(filename), md5sum)
7878
if retry < retry_limit:
7979
retry += 1
8080
else:
8181
raise RuntimeError("Cannot download {0} within retry limit {1}".
8282
format(url, retry_limit))
83-
print(("Cache file %s not found, downloading %s" % (filename, url)))
83+
print("Cache file %s not found, downloading %s" % (filename, url))
8484
r = requests.get(url, stream=True)
8585
total_length = r.headers.get('content-length')
8686

@@ -189,7 +189,7 @@ def reader():
189189
my_file_list = []
190190
for idx, fn in enumerate(file_list):
191191
if idx % trainer_count == trainer_id:
192-
print(("append file: %s" % fn))
192+
print("append file: %s" % fn)
193193
my_file_list.append(fn)
194194
for fn in my_file_list:
195195
with open(fn, "r") as f:

python/paddle/dataset/movielens.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
1717
Movielens 1-M dataset contains 1 million ratings from 6000 users on 4000
1818
movies, which was collected by GroupLens Research. This module will download
19-
Movielens 1-M dataset from
19+
Movielens 1-M dataset from
2020
http://files.grouplens.org/datasets/movielens/ml-1m.zip and parse training
2121
set and test set into paddle reader creators.
2222
@@ -243,7 +243,7 @@ def unittest():
243243
for test_count, _ in enumerate(test()()):
244244
pass
245245

246-
print((train_count, test_count))
246+
print(train_count, test_count)
247247

248248

249249
def fetch():

python/paddle/dataset/mq2007.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class Query(object):
5353
----------
5454
query_id : int
5555
query_id in dataset, mapping from query to relevance documents
56-
relevance_score : int
56+
relevance_score : int
5757
relevance score of query and document pair
5858
feature_vector : array, dense feature
5959
feature in vector format
@@ -92,7 +92,7 @@ def _parse_(self, text):
9292
sys.stdout.write("expect 48 space split parts, get %d" %
9393
(len(parts)))
9494
return None
95-
# format : 0 qid:10 1:0.000272 2:0.000000 ....
95+
# format : 0 qid:10 1:0.000272 2:0.000000 ....
9696
self.relevance_score = int(parts[0])
9797
self.query_id = int(parts[1].split(':')[1])
9898
for p in parts[2:]:
@@ -295,7 +295,7 @@ def __reader__(filepath, format="pairwise", shuffle=False, fill_missing=-1):
295295
--------
296296
filename : string
297297
fill_missing : fill the missing value. default in MQ2007 is -1
298-
298+
299299
Returns
300300
------
301301
yield
@@ -330,4 +330,4 @@ def fetch():
330330
mytest = functools.partial(
331331
__reader__, filepath="MQ2007/MQ2007/Fold1/sample", format="listwise")
332332
for label, query in mytest():
333-
print((label, query))
333+
print(label, query)

python/paddle/dataset/sentiment.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def download_data_if_not_yet():
4747
nltk.download(
4848
'movie_reviews', download_dir=paddle.dataset.common.DATA_HOME)
4949
print("Download data set success.....")
50-
print(("Path is " + nltk.data.find('corpora/movie_reviews').path))
50+
print("Path is " + nltk.data.find('corpora/movie_reviews').path)
5151

5252

5353
def get_word_dict():

0 commit comments

Comments
 (0)