code: def _tuner_test_helper(
      model,
      tuner_name,
      tmpdir_name,
      early_stopping=1,
      prior_records=None,
  ):
      tvmc_model = tvmc.frontends.load_model(model)
      log_file = os.path.join(
          tmpdir_name, "log_{}.txt".format(tuner_name)
      )
  
      tvmc.tune(
          tvmc_model,
          target="llvm",
          tuning_records=log_file,
          prior_records=prior_records,
          tuner=tuner_name,
          trials=4,
          early_stopping=early_stopping,
      )
  
      # testing whether the log file was produced
      assert path.exists(log_file), "tuning log file should exist"
  
      with autotvm.apply_history_best(log_file) as best:
          assert isinstance(
              best, autotvm.task.dispatcher.ApplyHistoryBest
          ), "unable to load the best results of tuning"
  
      return log_file
  
imports: import platform
  import pytest
  import os
  from unittest import mock
  from os import path
  from pathlib import Path
  import tvm
  import tvm.testing
  from tvm import autotvm, auto_scheduler
  from tvm.driver import tvmc
  from tvm.driver.tvmc.autotuner import filter_tasks, gen_task_list
label_desc: Use image node_id 3 for calling a global function with example usage: _tuner_test_helper(model, tuner_name, tmpdir_name, early_stopping, prior_records) and returns: log_file