code: def test_get_winners_df() -> None:
      dfdata = [
          ["alg0", 46424, 0.4],
          ["alg1", 4324546, 0.1],
          ["alg1", 424546, 0.5],
          ["alg2", 1424546, 0.3],
      ]
      df = pd.DataFrame(
          columns=["optimizer_name", "blublu", "loss"], data=dfdata
      )
      all_optimizers = [f"alg{k}" for k in range(4)]
      # blublu column is useless, and losses are meaned for each algorithm
      winners = plotting._make_winners_df(df, all_optimizers)
      data = 0.5 * np.identity(4)  # self playing is a tie
      # unspecified algo
      data[(3, 3)] = 0  # type: ignore
      # alg1 and alg2 win over alg0  # type: ignore
      data[tuple(zip(*[(1, 0), (2, 0)]))] = 1  # type: ignore
      # alg1 and alg2 are a tie (mean loss .3)
      data[tuple(zip(*[(1, 2), (2, 1)]))] = 0.5  # type: ignore
      expected = pd.DataFrame(
          index=all_optimizers, columns=all_optimizers, data=data
      )
      winners.assert_equivalent(expected)
  
imports: from .None import plotting
  from unittest.mock import patch
  from pathlib import Path
  import typing
  import pytest
  import numpy
  import pandas
  import matplotlib
  from nevergrad.common import testing
  from .None import utils
label_desc: Use image node_id 1 for calling a global function with example usage: test_get_winners_df() without return types