class_docstr: Object representing the distributed acyclic graph (DAG) of jobs to run.
  
  Examples
  --------
  Create a batch object:
  
  >>> p = Batch()
  
  Create a new job that prints "hello":
  
  >>> t = p.new_job()
  >>> t.command(f'echo "hello" ')
  
  Execute the DAG:
  
  >>> p.run()
  
  Notes
  -----
  
  The methods :meth:`.Batch.read_input` and :meth:`.Batch.read_input_group`
  are for adding input files to a batch. An input file is a file that already
  exists before executing a batch and is not present in the docker container
  the job is being run in.
  
  Files generated by executing a job are temporary files and must be written
  to a permanent location using the method :meth:`.Batch.write_output`.
  
  Parameters
  ----------
  name:
      Name of the batch.
  backend:
      Backend used to execute the jobs. If no backend is specified, a backend
      will be created by first looking at the environment variable HAIL_BATCH_BACKEND,
      then the hailctl config variable batch/backend. These configurations, if set,
      can be either `local` or `service`, and will result in the use of a
      :class:`.LocalBackend` and :class:`.ServiceBackend` respectively. If no
      argument is given and no configurations are set, the default is
      :class:`.LocalBackend`.
  attributes:
      Key-value pairs of additional attributes. 'name' is not a valid keyword.
      Use the name argument instead.
  requester_pays_project:
      The name of the Google project to be billed when accessing requester pays buckets.
  default_image:
      Default docker image to use for Bash jobs. This must be the full name of the
      image including any repository prefix and tags if desired (default tag is `latest`).
  default_memory:
      Memory setting to use by default if not specified by a job. Only
      applicable if a docker image is specified for the :class:`.LocalBackend`
      or the :class:`.ServiceBackend`. See :meth:`.Job.memory`.
  default_cpu:
      CPU setting to use by default if not specified by a job. Only
      applicable if a docker image is specified for the :class:`.LocalBackend`
      or the :class:`.ServiceBackend`. See :meth:`.Job.cpu`.
  default_storage:
      Storage setting to use by default if not specified by a job. Only
      applicable for the :class:`.ServiceBackend`. See :meth:`.Job.storage`.
  default_timeout:
      Maximum time in seconds for a job to run before being killed. Only
      applicable for the :class:`.ServiceBackend`. If `None`, there is no
      timeout.
  default_python_image:
      Default image to use for all Python jobs. This must be the full name of the image including
      any repository prefix and tags if desired (default tag is `latest`). The image must have
      the `dill` Python package installed and have the same version of Python installed that is
      currently running. If `None`, a tag of the `hailgenetics/hail` image will be chosen
      according to the current Hail and Python version.
  default_spot:
      If unspecified or ``True``, jobs will run by default on spot instances. If ``False``, jobs
      will run by default on non-spot instances. Each job can override this setting with
      :meth:`.Job.spot`.
  project:
      DEPRECATED: please specify `google_project` on the ServiceBackend instead. If specified,
      the project to use when authenticating with Google Storage. Google Storage is used to
      transfer serialized values between this computer and the cloud machines that execute Python
      jobs.
  cancel_after_n_failures:
      Automatically cancel the batch after N failures have occurred. The default
      behavior is there is no limit on the number of failures. Only
      applicable for the :class:`.ServiceBackend`. Must be greater than 0.
docstr: Execute a batch.
  
  Examples
  --------
  
  Create a simple batch with one job and execute it:
  
  >>> b = Batch()
  >>> j = b.new_job()
  >>> j.command('echo "hello world"')
  >>> b.run()
  
  
  Parameters
  ----------
  dry_run:
      If `True`, don't execute code.
  verbose:
      If `True`, print debugging output.
  delete_scratch_on_exit:
      If `True`, delete temporary directories with intermediate files.
  backend_kwargs:
      See :meth:`.Backend._run` for backend-specific arguments.
docstr_tok: ["Execute","a","batch",".","Examples","--","--","--","--","Create","a","simple","batch","with","one","job","and","execute","it",":",">",">",">","b","=","Batch","(",")",">",">",">","j","=","b.new_job","(",")",">",">",">","j.command","(","'echo","``","hello","world","''","'",")",">",">",">","b.run","(",")","Parameters","--","--","--","--","--","dry_run",":","If","`","True","`",",","do","n't","execute","code",".","verbose",":","If","`","True","`",",","print","debugging","output",".","delete_scratch_on_exit",":","If","`","True","`",",","delete","temporary","directories","with","intermediate","files",".","backend_kwargs",":","See",":","meth",":","`",".Backend._run","`","for","backend-specific","arguments","."]
code: def run(
      self,
      dry_run: bool = False,
      verbose: bool = False,
      delete_scratch_on_exit: bool = True,
      **backend_kwargs: Any,
  ) -> Optional[_bc.Batch]:
      """
      Execute a batch.
  
      Examples
      --------
  
      Create a simple batch with one job and execute it:
  
      >>> b = Batch()
      >>> j = b.new_job()
      >>> j.command('echo "hello world"')
      >>> b.run()
  
  
      Parameters
      ----------
      dry_run:
          If `True`, don't execute code.
      verbose:
          If `True`, print debugging output.
      delete_scratch_on_exit:
          If `True`, delete temporary directories with intermediate files.
      backend_kwargs:
          See :meth:`.Backend._run` for backend-specific arguments.
      """
      return async_to_blocking(
          self._async_run(
              dry_run, verbose, delete_scratch_on_exit, **backend_kwargs
          )
      )
  
imports: import os
  import warnings
  import re
  from typing import Callable, Optional, Dict, Union, List, Any, Set
  from io import BytesIO
  import dill
  from hailtop.utils import secret_alnum_string, url_scheme, async_to_blocking
  from hailtop.aiotools import AsyncFS
  from hailtop.aiocloud.aioazure.fs import AzureAsyncFS
  from hailtop.aiotools.router_fs import RouterAsyncFS
  import hailtop.batch_client.client
  import hailtop.batch_client.aioclient
  from hailtop.config import ConfigVariable, configuration_of
  from .None import backend, job, resource
  from .exceptions import BatchException
label_desc: Use image node_id 20 for calling the Batch obj's underlying member method code with example usage: obj.run(dry_run, verbose, delete_scratch_on_exit) and returns: async_to_blocking