class_docstr: Object representing a single job to execute.
  
  Notes
  -----
  This class should never be created directly by the user. Use :meth:`.Batch.new_job`,
  :meth:`.Batch.new_bash_job`, or :meth:`.Batch.new_python_job` instead.
class_docstr_tok: ["Object","representing","a","single","job","to","execute",".","Notes","--","--","-","This","class","should","never","be","created","directly","by","the","user",".","Use",":","meth",":","`",".Batch.new_job","`",",",":","meth",":","`",".Batch.new_bash_job","`",",","or",":","meth",":","`",".Batch.new_python_job","`","instead","."]
code: def __init__(
      self,
      batch: "batch.Batch",
      token: str,
      *,
      name: Optional[str] = None,
      attributes: Optional[Dict[str, str]] = None,
      shell: Optional[str] = None,
  ):
      self._batch = batch
      self._shell = shell
      self._token = token
  
      self.name = name
      self.attributes = attributes
  
      self._cpu: Optional[str] = None
      self._memory: Optional[str] = None
      self._storage: Optional[str] = None
      self._image: Optional[str] = None
      self._always_run: bool = False
      self._preemptible: Optional[bool] = None
      self._machine_type: Optional[str] = None
      self._timeout: Optional[Union[int, float]] = None
      self._cloudfuse: List[Tuple[str, str, bool]] = []
      self._always_copy_output: bool = False
      self._env: Dict[str, str] = {}
      self._wrapper_code: List[str] = []
      self._user_code: List[str] = []
      self._regions: Optional[List[str]] = None
  
      self._resources: Dict[str, _resource.Resource] = {}
      self._resources_inverse: Dict[_resource.Resource, str] = {}
      self._uid = Job._new_uid()
      self._job_id: Optional[int] = None
  
      self._inputs: Set[_resource.Resource] = set()
      self._internal_outputs: Set[
          Union[_resource.ResourceFile, _resource.PythonResult]
      ] = set()
      self._external_outputs: Set[
          Union[_resource.ResourceFile, _resource.PythonResult]
      ] = set()
      self._mentioned: Set[
          _resource.Resource
      ] = set()  # resources used in the command
      self._valid: Set[
          _resource.Resource
      ] = set()  # resources declared in the appropriate place
      self._dependencies: Set[Job] = set()
      self._submitted: bool = False
      self._client_job: Optional[bc.Job] = None
  
      def safe_str(s):
          new_s = []
          for c in s:
              if c.isalnum() or c == "-":
                  new_s.append(c)
              else:
                  new_s.append("_")
          return "".join(new_s)
  
      self._dirname = (
          f"{safe_str(name)}-{self._token}" if name else self._token
      )
  
imports: import asyncio
  import inspect
  import os
  import re
  import textwrap
  import warnings
  from shlex import quote
  from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Union, cast, Literal
  from typing_extensions import Self
  import hailtop.batch_client.client
  from .None import backend, batch
  from .None import resource
  from .exceptions import BatchException
label_desc: Use image node_id 2 to create a new Job object  with example: obj = Job(batch, token)