code: def test_regret_sequential():
      """Tests that cumulative best objectives are linked to their respective ids"""
      data = pd.DataFrame(
          data={
              "id": ["a", "b", "c", "d"],
              "objective": [10, 12, 8, 9],
          }
      )
  
      expected_best = [10, 10, 8, 8]
      expected_ids = ["a", "a", "c", "c"]
  
      result = regret(data)
  
      assert all(result["best"].values == expected_best)
      assert all(result["best_id"].values == expected_ids)
  
      data = pd.DataFrame(
          data={
              "id": ["a", "b", "c"],
              "objective": [10, 9, 8],
          }
      )
  
      expected_best = [10, 9, 8]
      expected_ids = ["a", "b", "c"]
  
      result = regret(data)
  
      assert all(result["best"].values == expected_best)
      assert all(result["best_id"].values == expected_ids)
  
      data = pd.DataFrame(
          data={
              "id": ["a", "b", "c"],
              "objective": [8, 9, 10],
          }
      )
  
      expected_best = [8, 8, 8]
      expected_ids = ["a", "a", "a"]
  
      result = regret(data)
  
      assert all(result["best"].values == expected_best)
      assert all(result["best_id"].values == expected_ids)
  
      data = pd.DataFrame(
          data={
              "id": ["a"],
              "objective": [10],
          }
      )
  
      result = regret(data)
  
      assert all(result["best"].values == [10])
      assert all(result["best_id"].values == ["a"])
  
file_path: orion/tests/unittests/analysis/test_regret.py
imports: import pandas
  import pytest
  from orion.analysis import regret
label_desc: Use image node_id 7 for calling a global function with example usage: test_regret_sequential() without return types