code: def test_study_add_observation_with_iteration():
      s = get_mock_study()
      t = s.get_suggestion()
      s.add_observation(
          trial=t,
          objective=0.1,
          context={"other_metrics": 0.2},
          iteration=1,
      )
      s.add_observation(
          trial=t,
          objective=0.01,
          context={"other_metrics": 0.02},
          iteration=2,
      )
      expected_df = pandas.DataFrame(
          collections.OrderedDict(
              [
                  ("Trial-ID", [1, 1]),
                  ("Status", ["INTERMEDIATE", "INTERMEDIATE"]),
                  ("Iteration", [1, 2]),
                  ("a", [1, 1]),
                  ("b", [2, 2]),
                  ("Objective", [0.1, 0.01]),
                  ("other_metrics", [0.2, 0.02]),
              ]
          )
      )
      assert s.results.equals(expected_df)
  
file_path: sherpa/tests/test_study.py
imports: import pytest
  import sherpa
  import sherpa.core
  import sherpa.schedulers
  import sherpa.database
  import pandas
  import collections
  from testing_utils import *
label_desc: Use image node_id 5 for calling a global function with example usage: test_study_add_observation_with_iteration() without return types