code: def test_regret_equal():
      """Tests instances where trials share best objectives"""
      data = pd.DataFrame(
          data={
              "id": ["a", "b", "c"],
              "objective": [8, 9, 8],
          }
      )
  
      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", "b", "c"],
              "objective": [8, 8, 8],
          }
      )
  
      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)
  
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 8 for calling a global function with example usage: test_regret_equal() without return types