code: def test_normalized_losses() -> None:
      data = [
          ["alg0", 0, "sphere", 3],
          ["alg0", -2, "sphere", 3],
          ["alg2", 2, "sphere", 3],
          ["alg3", 12, "sphere", 12],
          ["alg2", 5, "sphere", 12],
          ["alg4", 24, "ellipsoid", 3],
          ["alg5", float("inf"), "sphere", 3],
      ]
      df = pd.DataFrame(
          columns=["optimizer_name", "loss", "func", "dimension"],
          data=data,
      )
      ndf = plotting.normalized_losses(df, ["func", "dimension"])
      np.testing.assert_array_equal(
          ndf.loss, [0.5, 0, 1, 1, 0, 1, float("inf")]
      )
  
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 13 for calling a global function with example usage: test_normalized_losses() without return types