code: def assert_loss(job, **kwargs):
      assert (
          job.status == ExecutionStatus.Success
      ), "job should be successful"
      assert type(job[0].loss) == float, "loss should be an float"
      decimal = kwargs.get("decimal", 2)
      assert_almost_equal(
          job[0].loss, kwargs["expected_loss"], decimal=decimal
      )
  
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 6 for calling a global function with example usage: assert_loss(job) without return types