code: def check_project_spec(
      project_spec,
      api,
      uri=None,
      job=None,
      project=None,
      entity=None,
      launch_config=None,
      resource="local-container",
      resource_args=None,
      docker_image=None,
  ):
      assert project_spec.uri == uri
      assert project_spec.job == job
      expected_project = project or uri.split("/")[4]
      assert project_spec.target_project == expected_project
      expected_target_entity = entity or api.default_entity
      assert project_spec.target_entity == expected_target_entity
      if (
          launch_config
          and launch_config.get("config")
          and launch_config["config"].get("overrides")
          and launch_config["config"]["overrides"].get("run_config")
      ):
          assert (
              project_spec.override_config
              == launch_config["config"]["overrides"]["run_config"]
          )
      assert project_spec.resource == resource
      if resource_args:
          assert {(k, v) for k, v in resource_args.items()} == {
              (k, v) for k, v in project_spec.resource_args.items()
          }
      if project_spec.source == _project_spec.LaunchSource.WANDB:
          with open(
              os.path.join(project_spec.project_dir, "patch.txt")
          ) as fp:
              contents = fp.read()
              assert contents == "testing"
      assert project_spec.image_name is not None
  
imports: import json
  import multiprocessing.pool
  import os
  import sys
  from unittest import mock
  from unittest.mock import MagicMock
  import pytest
  import wandb
  import wandb.sdk.launch._launch
  import wandb.sdk.launch._project_spec
  import yaml
  from wandb.apis import PublicApi
  from wandb.sdk.launch.agent.agent import LaunchAgent
  from wandb.sdk.launch.builder.build import _inject_wandb_config_env_vars
  from wandb.sdk.launch.builder.docker_builder import DockerBuilder
  from wandb.sdk.launch.errors import LaunchError
  from wandb.sdk.launch.utils import LAUNCH_DEFAULT_PROJECT, PROJECT_SYNCHRONOUS, pull_docker_image
  from wandb.sdk.lib import runid
  from tests.pytest_tests.unit_tests_old.utils import fixture_open, notebook_path
label_desc: Use image node_id 11 for calling a global function with example usage: check_project_spec(project_spec, api, uri, job, project, entity, launch_config, resource, resource_args, docker_image) without return types