code: def get_base_setup(
      launch_project: LaunchProject, py_version: str, py_major: str
  ) -> str:
      """Fill in the Dockerfile templates for stage 2 of build.
  
      CPU version is built on python, Accelerator version is built on user provided.
      """
      python_base_image = f"python:{py_version}-buster"
      if launch_project.accelerator_base_image:
          _logger.info(
              f"Using accelerator base image: {launch_project.accelerator_base_image}"
          )
          # accelerator base images doesn't come with python tooling
          if py_major == "2":
              python_packages = [
                  f"python{py_version}",
                  f"libpython{py_version}",
                  "python-pip",
                  "python-setuptools",
              ]
          else:
              python_packages = [
                  f"python{py_version}",
                  f"libpython{py_version}",
                  "python3-pip",
                  "python3-setuptools",
              ]
          base_setup = ACCELERATOR_SETUP_TEMPLATE.format(
              accelerator_base_image=launch_project.accelerator_base_image,
              python_packages=" \\\n".join(python_packages),
              py_version=py_version,
          )
      else:
          python_packages = [
              "python3-dev" if py_major == "3" else "python-dev",
              "gcc",
          ]  # gcc required for python < 3.7 for some reason
          base_setup = PYTHON_SETUP_TEMPLATE.format(
              py_base_image=python_base_image
          )
      return base_setup
  
imports: import hashlib
  import json
  import logging
  import os
  import shlex
  import shutil
  import sys
  import tempfile
  from typing import Any, Dict, List, Optional, Tuple
  import pkg_resources
  import yaml
  from dockerpycreds.utils import find_executable
  from six.moves import shlex_quote
  import wandb
  import wandb.docker
  import wandb.env
  from wandb.apis.internal import Api
  from wandb.sdk.launch.loader import builder_from_config, environment_from_config, registry_from_config
  from .._project_spec import EntryPoint, EntrypointDefaults, LaunchProject, fetch_and_validate_project
  from ..errors import ExecutionError, LaunchError
  from ..registry.abstract import AbstractRegistry
  from ..utils import AZURE_CONTAINER_REGISTRY_URI_REGEX, ELASTIC_CONTAINER_REGISTRY_URI_REGEX, GCP_ARTIFACT_REGISTRY_URI_REGEX, LAUNCH_CONFIG_FILE, LOG_PREFIX, event_loop_thread_exec, resolve_build_and_registry_config
label_desc: Use image node_id 4 for calling a global function with example usage: get_base_setup(launch_project, py_version, py_major) and returns: base_setup