code: def test_from_to_history(generated_history):
      history, domain = generated_history
      rep = Table(
          domain,
          metrics=["metric_1", "metric_2"],
          primary_metric="metric_1",
      )
      rep.from_history(history)
      data_history = [
          [
              i + 1,
              *list(h.sample.flatten().values()),
              *list(h.metrics.values()),
          ]
          for i, h in enumerate(history)
      ]
      assert rep.data.tolist() == data_history
      assert rep.to_history() == history
  
imports: import os
  import tempfile
  from hypertunity.optimisation.base import EvaluationScore
  from ..table import Table
label_desc: Use image node_id 1 for calling a global function with example usage: test_from_to_history(generated_history) without return types