code: def test_gpt3():
      if "OPENAI_API_SECRET_KEY" not in os.environ:
          os.environ["OPENAI_API_SECRET_KEY"] = ""
      gpt3 = models.get_model("gpt3").create_from_arg_string(
          "engine=ada"
      )
      (
          (ll_dog, ig_dog),
          (ll_cat, ig_cat),
          (_, ll_max_0),
          (_, ll_max_1),
          (_, ll_max_2),
          *vals,
      ) = gpt3.loglikelihood(LOGLIKELIHOOD_TEST_CASES)
  
      assert ll_dog > ll_cat
      assert not ig_cat
  
      assert ig_dog
      assert not ll_max_0
      assert not ll_max_1
      assert not ll_max_2
  
      # test empty context
      gpt3.loglikelihood([("", "test")])
  
      (gen,) = gpt3.greedy_until(
          [("The quick brown fox jumps over the lazy", [".", "\n"])]
      )
  
      assert gen == " dog"
  
      print([x[0] for x in vals])
  
      targets = [
          -34.848301606999996,
          -47.148329679999996,
          -45.44380149599999,
          -5.285246016,
          -133.97821690686004,
          -321.2616693239001,
          -658.0299524401041,
          -34.848301606999996,
          -7.525115,
      ]
  
      for (pred, _), tgt in zip(vals, targets):
          assert pred == pytest.approx(tgt, rel=1e-3)
  
file_path: lm-evaluation-harness/tests/test_models.py
imports: import hashlib
  import json
  import openai
  import os
  import pickle
  import pytest
  import unittest.mock
  import lm_eval.models
label_desc: Use image node_id 4 for calling a global function with example usage: test_gpt3() without return types