class_docstr: Backend that executes batches on a local computer.
  Examples
  --------
  
  >>> local_backend = LocalBackend(tmp_dir='/tmp/user/')
  >>> b = Batch(backend=local_backend)
  
  Parameters
  ----------
  tmp_dir:
      Temporary directory to use.
  gsa_key_file:
      Mount a file with a gsa key to `/gsa-key/key.json`. Only used if a
      job specifies a docker image. This option will override the value set by
      the environment variable `HAIL_BATCH_GSA_KEY_FILE`.
  extra_docker_run_flags:
      Additional flags to pass to `docker run`. Only used if a job specifies
      a docker image. This option will override the value set by the environment
      variable `HAIL_BATCH_EXTRA_DOCKER_RUN_FLAGS`.
class_docstr_tok: ["Backend","that","executes","batches","on","a","local","computer",".","Examples","--","--","--","--",">",">",">","local_backend","=","LocalBackend","(","tmp_dir='\/tmp\/user\/","'",")",">",">",">","b","=","Batch","(","backend=local_backend",")","Parameters","--","--","--","--","--","tmp_dir",":","Temporary","directory","to","use",".","gsa_key_file",":","Mount","a","file","with","a","gsa","key","to","`","\/gsa-key\/key.json","`",".","Only","used","if","a","job","specifies","a","docker","image",".","This","option","will","override","the","value","set","by","the","environment","variable","`","HAIL_BATCH_GSA_KEY_FILE","`",".","extra_docker_run_flags",":","Additional","flags","to","pass","to","`","docker","run","`",".","Only","used","if","a","job","specifies","a","docker","image",".","This","option","will","override","the","value","set","by","the","environment","variable","`","HAIL_BATCH_EXTRA_DOCKER_RUN_FLAGS","`","."]
code: def __init__(
      self,
      tmp_dir: str = "/tmp/",
      gsa_key_file: Optional[str] = None,
      extra_docker_run_flags: Optional[str] = None,
  ):
      super().__init__(
          GCSRequesterPaysFSCache(fs_constructor=RouterAsyncFS)
      )
      self._tmp_dir = tmp_dir.rstrip("/")
  
      flags = ""
  
      if extra_docker_run_flags is not None:
          flags += extra_docker_run_flags
      elif (
          os.environ.get("HAIL_BATCH_EXTRA_DOCKER_RUN_FLAGS")
          is not None
      ):
          flags += os.environ["HAIL_BATCH_EXTRA_DOCKER_RUN_FLAGS"]
  
      if gsa_key_file is None:
          gsa_key_file = os.environ.get("HAIL_BATCH_GSA_KEY_FILE")
      if gsa_key_file is not None:
          flags += f" -v {gsa_key_file}:/gsa-key/key.json"
  
      self._extra_docker_run_flags = flags
      self.__fs = self._requester_pays_fses[None]
  
imports: from typing import Optional, Dict, Any, TypeVar, Generic, List, Union, ClassVar
  import abc
  import asyncio
  import collections
  import orjson
  import os
  import subprocess
  import uuid
  import time
  import functools
  import copy
  from shlex import quote
  import webbrowser
  import warnings
  from rich.progress import track
  from hailtop import pip_version
  from hailtop.config import ConfigVariable, configuration_of, get_deploy_config, get_remote_tmpdir
  from hailtop.utils.rich_progress_bar import SimpleCopyToolProgressBar
  from hailtop.utils.gcs_requester_pays import GCSRequesterPaysFSCache
  from hailtop.utils import parse_docker_image_reference, async_to_blocking, bounded_gather, url_scheme
  from hailtop.batch.hail_genetics_images import HAIL_GENETICS_IMAGES, hailgenetics_hail_image_for_current_python_version
  from hailtop.batch_client.parse import parse_cpu_in_mcpu
  import hailtop.batch_client.client
  from hailtop.batch_client.client import BatchClient
  from hailtop.batch_client.aioclient import BatchClient
  from hailtop.aiotools.router_fs import RouterAsyncFS
  from hailtop.aiocloud.aiogoogle import GCSRequesterPaysConfiguration
  from .None import resource, batch
  from .job import PythonJob
  from .exceptions import BatchException
  from .globals import DEFAULT_SHELL
  from hailtop.aiotools.validators import validate_file
label_desc: Use image node_id 1 to create a new LocalBackend object from inherited base classes: Backend with example: obj = LocalBackend(tmp_dir, gsa_key_file, extra_docker_run_flags)