Looks like this check (is valid file) is done in some metrics and not others. Why is that? Also, may be this should be done in Metric.py or some other common place.