code: def get_shim_commands(
      backend: BackendType,
      image_name: str,
      authorized_keys: List[str],
      registry_auth_required: bool,
  ) -> List[str]:
      build = get_dstack_runner_version()
      env = {
          "DSTACK_BACKEND": backend.value,
          "DSTACK_RUNNER_LOG_LEVEL": "6",
          "DSTACK_RUNNER_VERSION": build,
          "DSTACK_IMAGE_NAME": image_name,
          "DSTACK_PUBLIC_SSH_KEY": "\n".join(authorized_keys),
          "DSTACK_HOME": "/root/.dstack",
      }
      commands = get_dstack_shim(build)
      for k, v in env.items():
          commands += [f'export "{k}={v}"']
      commands += get_run_shim_script(registry_auth_required)
      return commands
  
imports: import os
  import re
  from abc import ABC, abstractmethod
  from typing import List, Optional
  import git
  import requests
  import yaml
  from dstack import version
  from dstack._internal import settings
  from dstack._internal.core.models.backends.base import BackendType
  from dstack._internal.core.models.instances import InstanceOfferWithAvailability, InstanceState, LaunchedGatewayInfo, LaunchedInstanceInfo
  from dstack._internal.core.models.runs import Job, Requirements, Run
  from dstack._internal.utils.logging import get_logger
label_desc: Use image node_id 3 for calling a global function with example usage: get_shim_commands(backend, image_name, authorized_keys, registry_auth_required) and returns: commands