class_docstr: Handle the lifecycle and configuration of a local container execution.
  
  This class is responsible for creating the directories and configuration
  files that the docker containers will use for either training or serving.
class_docstr_tok: ["Handle","the","lifecycle","and","configuration","of","a","local","container","execution",".","This","class","is","responsible","for","creating","the","directories","and","configuration","files","that","the","docker","containers","will","use","for","either","training","or","serving","."]
docstr: Gets the Docker Compose command.
  
  The method initially looks for 'docker compose' v2
  executable, if not found looks for 'docker-compose' executable.
  
  Returns:
      Docker Compose executable split into list.
  
  Raises:
      ImportError: If Docker Compose executable was not found.
docstr_tok: ["Gets","the","Docker","Compose","command",".","The","method","initially","looks","for","'docker","compose","'","v2","executable",",","if","not","found","looks","for","'docker-compose","'","executable",".","Returns",":","Docker","Compose","executable","split","into","list",".","Raises",":","ImportError",":","If","Docker","Compose","executable","was","not","found","."]
code: def _get_compose_cmd_prefix():
      """Gets the Docker Compose command.
  
      The method initially looks for 'docker compose' v2
      executable, if not found looks for 'docker-compose' executable.
  
      Returns:
          Docker Compose executable split into list.
  
      Raises:
          ImportError: If Docker Compose executable was not found.
      """
      compose_cmd_prefix = []
  
      output = None
      try:
          output = subprocess.check_output(
              ["docker", "compose", "version"],
              stderr=subprocess.DEVNULL,
              encoding="UTF-8",
          )
      except subprocess.CalledProcessError:
          logger.info(
              "'Docker Compose' is not installed. "
              "Proceeding to check for 'docker-compose' CLI."
          )
  
      if output and "v2" in output.strip():
          logger.info("'Docker Compose' found using Docker CLI.")
          compose_cmd_prefix.extend(["docker", "compose"])
          return compose_cmd_prefix
  
      if find_executable("docker-compose") is not None:
          logger.info(
              "'Docker Compose' found using Docker Compose CLI."
          )
          compose_cmd_prefix.extend(["docker-compose"])
          return compose_cmd_prefix
  
      raise ImportError(
          "Docker Compose is not installed. "
          "Local Mode features will not work without docker compose. "
          "For more information on how to install 'docker compose', please, see "
          "https://docs.docker.com/compose/install/"
      )
  
imports: from __future__ import absolute_import, annotations
  import base64
  import copy
  import errno
  import json
  import logging
  import os
  import platform
  import random
  import re
  import shlex
  import shutil
  import string
  import subprocess
  import sys
  import tarfile
  import tempfile
  from distutils.spawn import find_executable
  from threading import Thread
  from typing import Dict, List
  from six.moves.urllib.parse import urlparse
  import sagemaker
  from sagemaker.config.config_schema import CONTAINER_CONFIG, LOCAL
  import sagemaker.local.data
  import sagemaker.local.utils
  import sagemaker.utils
label_desc: Use image node_id 2 for calling the _SageMakerContainer obj's underlying member method code with example usage: obj._get_compose_cmd_prefix() and returns: compose_cmd_prefix, compose_cmd_prefix