code: def test_create_job_artifact(runner, user, wandb_init, test_settings):
      proj = "test-p"
      settings = test_settings({"project": proj})
  
      internal_api = InternalApi()
      public_api = PublicApi()
  
      # create code artifact dir
      source_dir = "./" + tempfile.TemporaryDirectory().name
      os.makedirs(source_dir)
  
      with open(f"{source_dir}/test.py", "w") as f:
          f.write("print('hello world')")
  
      # dump requirements.txt
      with open(f"{source_dir}/requirements.txt", "w") as f:
          f.write("wandb")
  
      artifact, action, aliases = _create_job(
          api=internal_api,
          path=source_dir,
          project=proj,
          entity=user,
          job_type="code",
          description="This is a description",
          entrypoint="test.py",
          name="test-job-9999",
          runtime="3.8.9",  # micro will get stripped
      )
  
      assert isinstance(artifact, Artifact)
      assert artifact.name == "test-job-9999:v0"
      assert action == "Created"
      assert aliases == ["latest"]
  
      job_v0 = public_api.job(f"{user}/{proj}/{artifact.name}")
  
      assert job_v0._partial
      assert job_v0._job_info["runtime"] == "3.8"
      assert job_v0._job_info["_version"] == "v0"
      assert job_v0._job_info["source"]["entrypoint"] == [
          "python3.8",
          "test.py",
      ]
      assert job_v0._job_info["source"]["notebook"] is False
  
      # Now use artifact as input, assert it gets upgraded
      artifact_env = json.dumps({"_wandb_job": artifact.name})
      with runner.isolated_filesystem(), mock.patch.dict(
          "os.environ", WANDB_ARTIFACTS=artifact_env
      ):
          settings.update(
              {
                  "job_source": "artifact",
                  "launch": True,
              }
          )
          run2 = wandb_init(settings=settings, config={"input1": 1})
          run2.log({"x": 2})
          run2.finish()
  
      # now get the job, the version should be v1
      v1_job = artifact.name.split(":")[0] + ":v1"
      job = public_api.job(f"{user}/{proj}/{v1_job}")
  
      assert job
  
      # assert updates to partial, and input/output types
      assert not job._partial
      output_type_keys = set(
          list(job._output_types._params["type_map"].keys())
      )
      assert output_type_keys == set(
          ["x", "_timestamp", "_runtime", "_step"]
      )
      for key in output_type_keys:
          assert (
              str(job._output_types._params["type_map"][key])
              == "Number"
          )
      assert str(job._input_types) == "{'input1': Number}"
  
file_path: wandb/tests/pytest_tests/system_tests/test_launch/test_job.py
imports: import json
  import os
  import tempfile
  from unittest import mock
  import pytest
  from wandb.apis.public import Api
  from wandb.sdk.artifacts.artifact import Artifact
  from wandb.sdk.internal.internal_api import Api
  from wandb.sdk.launch.create_job import _create_job
  from wandb.sdk.launch.git_reference import GitReference
label_desc: Use image node_id 2 for calling a global function with example usage: test_create_job_artifact(runner, user, wandb_init, test_settings) without return types