code: def _test_helper(
      vw_arg: str,
      num_iterations=2000,
      seed=10,
      has_automl=False,
      log_filename=None,
  ):
      vw = vowpalwabbit.Workspace(arg_str=vw_arg)
      has_automl = "automl" in vw.get_enabled_reductions()
      sim = Simulator(
          seed=seed, has_automl=has_automl, debug_logfile=log_filename
      )
      ctr = sim.run_simulation(
          vw,
          num_iterations,
          sim.users,
          sim.times_of_day,
          sim.actions,
          sim.get_cost,
      )
      vw.save("readable.vw")
      vw.finish()
      return ctr
  
imports: import vowpalwabbit
  from distributionally_robust_data import OnlineCressieRead
  import collections
  import os
  import random
  import os
label_desc: Use image node_id 1 for calling a global function with example usage: _test_helper(vw_arg, num_iterations, seed, has_automl, log_filename) and returns: ctr