def _convert_to_metrics_list(metrics):
    """Convert a dict of metrics names and weights as keys and values, into a list
    of dicts with the two keys "name" and "weight" as keys and the metrics name and
    metric weight as their corresponding values.

    Examples:
          metrics {"name1": 1.0, "name2": 2.0} results in the output
          [{"name": "name1", "weight": 1.0}, {"name": "name2", "weight": 2.0}]

    Args:
        metrics (dict[str, float]): metrics to convert

    Returns:
        list[dict[str, object]]: list of dicts with the two keys "name" and "weight" as
            keys and the metrics name and metric weight as their corresponding values.
    """
    metrics_list = []
    for metric_name, metric_weight in metrics.items():
        metrics_list.append({"name": metric_name, "weight": metric_weight})
    return metrics_list