def _get_latest_metric(metric_code):
    """Returns the date of the latest metric value."""
    try:
        # Get the latest metric value and return the date.
        last_metric = Metric.objects.filter(
            kind__code=metric_code).order_by('-start')[0]
        return last_metric
    except __HOLE__:
        return None
dataset/ETHPy150Open mozilla/kitsune/kitsune/kpi/cron.py/_get_latest_metric