Implement the flushing print function in a way that works in Python 2
from __future__ import print_function
+__true_print = print
import argparse
import datetime
@@ -13,8 +14,9 @@ import sys
import threading
import time
-from functools import partial
-print = partial(print, flush = True)
+def print(*args, **kwargs):
+ __true_print(*args, **kwargs)
+ sys.stdout.flush()
from ann_benchmarks.datasets import get_dataset, DATASETS
from ann_benchmarks.algorithms.definitions import Definition, instantiate_algorithm
