Revised custom_metric.py revised_branch