code: def assert_weight(job, **kwargs):
      atol = get_from_kwargs(kwargs, "atol", 10e-8)
      rtol = get_from_kwargs(kwargs, "rtol", 10e-5)
      expected_weights = kwargs["expected_weights"]
      assert (
          job.status == ExecutionStatus.Success
      ), f"{job.opts} job should be successful"
      data = job.outputs["--invert_hash"]
      with open(data[0], "r") as f:
          data = f.readlines()
      data = [i.strip() for i in data]
      weights = (
          job[0].model9("--invert_hash").weights.to_dict()["weight"]
      )
      for x in expected_weights:
          assert_allclose(
              [weights[x]], [expected_weights[x]], atol=atol, rtol=rtol
          ), f"weights {x} should be {expected_weights[x]}"
  
file_path: vowpal_wabbit/python/tests/e2e_v2/assert_job.py
imports: import numpy
  import os
  from numpy.testing import assert_allclose, assert_almost_equal
  from vw_executor.vw import ExecutionStatus
  import vowpalwabbit
  from test_helper import get_function_object, datagen_driver
label_desc: Use image node_id 4 for calling a global function with example usage: assert_weight(job) without return types