code: def assert_target(name, ob):
      fname = f"tests/testdata/{name}.json"
      if os.path.exists(fname):
          with open(fname) as fh:
              # Use relative tolerance of 1e-5 and absolute tolerance of 1e-8
              # assuming most metrics work on `float32` values, which is the common
              # default floating type across popular libraries (PyTorch, Tensorflow, and JAX).
              assert flatten(json.load(fh)) == pytest.approx(
                  flatten(json.loads(json.dumps(ob, sort_keys=True))),
                  rel=1e-5,
                  abs=1e-8,
              )
      else:
          with open(fname, "w") as fh:
              json.dump(ob, fh, sort_keys=True)
  
file_path: lm-evaluation-harness/tests/test_version_stable.py
imports: import lm_eval.tasks
  import lm_eval.models
  import lm_eval.evaluator
  import random
  import pytest
  import os
  import json
  import hashlib
  import collections
label_desc: Use image node_id 1 for calling a global function with example usage: assert_target(name, ob) without return types