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 the job to always copy output to cloud storage, even if the job failed.
  
  Notes
  -----
  Can only be used with the :class:`.backend.ServiceBackend`.
  
  Examples
  --------
  
  >>> b = Batch(backend=backend.ServiceBackend('test'))
  >>> j = b.new_job()
  >>> (j.always_copy_output()
  ...   .command(f'echo "hello" > {j.ofile} && false'))
  
  Parameters
  ----------
  always_copy_output:
      If True, set job to always copy output to cloud storage regardless
      of whether the job succeeded.
  
  Returns
  -------
  Same job object set to always copy output.
docstr_tok: ["Set","the","job","to","always","copy","output","to","cloud","storage",",","even","if","the","job","failed",".","Notes","--","--","-","Can","only","be","used","with","the",":","class",":","`",".backend.ServiceBackend","`",".","Examples","--","--","--","--",">",">",">","b","=","Batch","(","backend=backend.ServiceBackend","(","'test","'",")",")",">",">",">","j","=","b.new_job","(",")",">",">",">","(","j.always_copy_output","(",")","...",".command","(","f'echo","``","hello","''",">","{","j.ofile","}","&","&","false","'",")",")","Parameters","--","--","--","--","--","always_copy_output",":","If","True",",","set","job","to","always","copy","output","to","cloud","storage","regardless","of","whether","the","job","succeeded",".","Returns","--","--","--","-","Same","job","object","set","to","always","copy","output","."]
code: def always_copy_output(self, always_copy_output: bool = True) -> Self:
      """
      Set the job to always copy output to cloud storage, even if the job failed.
  
      Notes
      -----
      Can only be used with the :class:`.backend.ServiceBackend`.
  
      Examples
      --------
  
      >>> b = Batch(backend=backend.ServiceBackend('test'))
      >>> j = b.new_job()
      >>> (j.always_copy_output()
      ...   .command(f'echo "hello" > {j.ofile} && false'))
  
      Parameters
      ----------
      always_copy_output:
          If True, set job to always copy output to cloud storage regardless
          of whether the job succeeded.
  
      Returns
      -------
      Same job object set to always copy output.
      """
  
      if not isinstance(self._batch._backend, backend.ServiceBackend):
          raise NotImplementedError(
              "A ServiceBackend is required to use the 'always_copy_output' option"
          )
  
      self._always_copy_output = always_copy_output
      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 19 for calling the Job obj's underlying member method code with example usage: obj.always_copy_output(always_copy_output) and returns: self