def _metric_unit_from_name(metric_name):
    """
    Return a metric unit string for human consumption, that is inferred from
    the metric name.

    If a unit cannot be inferred, `None` is returned.
    """
    for item in _PATTERN_UNIT_LIST:
        pattern, unit = item
        if pattern.match(metric_name):
            return unit
    return None
def _metric_unit_from_name ( metric_name ) : for item in _PATTERN_UNIT_LIST : pattern , unit = item if pattern . match ( metric_name ) : return unit return None
Return a metric unit string for human consumption, that is inferred from
    the metric name.

    If a unit cannot be inferred, `None` is returned.