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: Cleans up directories and the like.
  
  Args:
      dirs_to_delete:
docstr_tok: ["Cleans","up","directories","and","the","like",".","Args",":","dirs_to_delete",":"]
code: def _cleanup(self, dirs_to_delete=None):
      """Cleans up directories and the like.
  
      Args:
          dirs_to_delete:
      """
      if dirs_to_delete:
          for d in dirs_to_delete:
              _delete_tree(d)
  
      # Free the container config files.
      for host in self.hosts:
          container_config_path = os.path.join(
              self.container_root, host
          )
          _delete_tree(container_config_path)
  
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 20 for calling the _SageMakerContainer obj's underlying member method code with example usage: obj._cleanup(dirs_to_delete) without return types