def reference_label(metric, reference):
    """
    Format a metric label for a reference.

    :return:
        A string that is used as the display value for a reference metric.
    """
    label = str.strip(metric.label or metric.alias)

    if reference is None:
        return label

    return '{} {}'.format(label, reference.label)