PY3: used six.moves.xrange to fix xrange in module test_metrics.py