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","."]
docstr: Set whether a job is run on spot instances. By default, all jobs run on spot instances.
  
  Examples
  --------
  
  Ensure a job only runs on non-spot instances:
  
  >>> b = Batch(backend=backend.ServiceBackend('test'))
  >>> j = b.new_job()
  >>> j = j.spot(False)
  >>> j = j.command(f'echo "hello"')
  
  Parameters
  ----------
  is_spot:
      If False, this job will be run on non-spot instances.
  
  Returns
  -------
  Same job object.
docstr_tok: ["Set","whether","a","job","is","run","on","spot","instances",".","By","default",",","all","jobs","run","on","spot","instances",".","Examples","--","--","--","--","Ensure","a","job","only","runs","on","non-spot","instances",":",">",">",">","b","=","Batch","(","backend=backend.ServiceBackend","(","'test","'",")",")",">",">",">","j","=","b.new_job","(",")",">",">",">","j","=","j.spot","(","False",")",">",">",">","j","=","j.command","(","f'echo","``","hello","''","'",")","Parameters","--","--","--","--","--","is_spot",":","If","False",",","this","job","will","be","run","on","non-spot","instances",".","Returns","--","--","--","-","Same","job","object","."]
code: def spot(self, is_spot: bool) -> Self:
      """
      Set whether a job is run on spot instances. By default, all jobs run on spot instances.
  
      Examples
      --------
  
      Ensure a job only runs on non-spot instances:
  
      >>> b = Batch(backend=backend.ServiceBackend('test'))
      >>> j = b.new_job()
      >>> j = j.spot(False)
      >>> j = j.command(f'echo "hello"')
  
      Parameters
      ----------
      is_spot:
          If False, this job will be run on non-spot instances.
  
      Returns
      -------
      Same job object.
      """
      self._preemptible = is_spot
      return self
  
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 14 for calling the Job obj's underlying member method code with example usage: obj.spot(is_spot) and returns: self