def METHOD_NAME(metric, results, pool=np.nanmedian):
    all_metrics = {}
    for target in results["targets"]:
        source = target["name"]
        metrics = [frame["metrics"][metric] for frame in target["frames"]]
        metrics = pool(metrics)
        all_metrics[source] = metrics
    return all_metrics