code: def test_versions_stable(taskname, task_class):
      task_dict = tasks.get_task_dict([taskname])
      lm = models.get_model("dummy")()
  
      def ll_fn(reqs):
          for ctx, cont in reqs:
              if len(ctx) == 0:
                  continue
              # space convention
              assert ctx[-1] != " "
              assert cont[0] == " " or ctx[-1] == "\n"
  
          assert_target_hashed(
              f"{taskname}-v{task_class.VERSION}-loglikelihood", reqs
          )
          res = []
  
          random.seed(42)
          for _ in reqs:
              res.append((-random.random(), False))
  
          return res
  
      def ll_perp_fn(reqs):
          for (string,) in reqs:
              assert isinstance(string, str)
  
          assert_target_hashed(
              f"{taskname}-v{task_class.VERSION}-loglikelihood_rolling",
              reqs,
          )
          res = []
  
          random.seed(42)
          for _ in reqs:
              res.append(-random.random())
  
          return res
  
      def greedy_until(reqs):
          res = []
          assert_target_hashed(
              f"{taskname}-v{task_class.VERSION}-greedy_until", reqs
          )
  
          for ctx, _ in reqs:
              res.append("lol")
              assert ctx.strip() != ""
  
          return res
  
      lm.loglikelihood = ll_fn
      lm.loglikelihood_rolling = ll_perp_fn
      lm.greedy_until = greedy_until
  
      limit = None
      result = evaluator.evaluate(
          lm=lm,
          task_dict=task_dict,
          num_fewshot=0,
          limit=limit,
          bootstrap_iters=10,
          description_dict=None,
      )
  
      assert_target(f"{taskname}-v{task_class.VERSION}-res", result)
  
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 4 for calling a global function with example usage: test_versions_stable(taskname, task_class) and returns: res, res, res