code: def test_load_dump():
      task, target = get_sample_task()
  
      inp = MeasureInput(target, task, task.config_space.get(0))
      result = MeasureResult(
          (2.0, 2.23, 0.23, 0.123, 0.234, 0.123),
          MeasureErrorNo.NO_ERROR,
          2.3,
          time.time(),
      )
  
      for protocol in ["json", "pickle"]:
          row = encode(inp, result, protocol=protocol)
          inp_2, result_2 = decode(row, protocol=protocol)
  
          assert measure_str_key(inp) == measure_str_key(
              inp_2
          ), "%s vs %s" % (
              measure_str_key(inp),
              measure_str_key(inp_2),
          )
          assert result.costs == result_2.costs
          assert result.error_no == result_2.error_no
          assert result.timestamp == result_2.timestamp
  
file_path: tvm/tests/python/autotvm/test_autotvm_record.py
imports: from io import StringIO
  from os import PathLike
  import time
  from tvm.contrib import utils
  from tvm import autotvm
  from tvm.autotvm.measure import MeasureInput, MeasureResult, MeasureErrorNo
  from tvm.autotvm.record import encode, decode, ApplyHistoryBest, measure_str_key
  from tvm.testing.autotvm import get_sample_task
label_desc: Use image node_id 1 for calling a global function with example usage: test_load_dump() without return types