class_docstr: Object representing a single bash job to execute.
  
  Examples
  --------
  
  Create a batch object:
  
  >>> b = Batch()
  
  Create a new bash job that prints hello to a temporary file `t.ofile`:
  
  >>> j = b.new_job()
  >>> j.command(f'echo "hello" > {j.ofile}')
  
  Write the temporary file `t.ofile` to a permanent location
  
  >>> b.write_output(j.ofile, 'hello.txt')
  
  Execute the DAG:
  
  >>> b.run()
  
  Notes
  -----
  This class should never be created directly by the user. Use :meth:`.Batch.new_job`
  or :meth:`.Batch.new_bash_job` instead.
class_docstr_tok: ["Object","representing","a","single","bash","job","to","execute",".","Examples","--","--","--","--","Create","a","batch","object",":",">",">",">","b","=","Batch","(",")","Create","a","new","bash","job","that","prints","hello","to","a","temporary","file","`","t.ofile","`",":",">",">",">","j","=","b.new_job","(",")",">",">",">","j.command","(","f'echo","``","hello","''",">","{","j.ofile","}","'",")","Write","the","temporary","file","`","t.ofile","`","to","a","permanent","location",">",">",">","b.write_output","(","j.ofile",",","'hello.txt","'",")","Execute","the","DAG",":",">",">",">","b.run","(",")","Notes","--","--","-","This","class","should","never","be","created","directly","by","the","user",".","Use",":","meth",":","`",".Batch.new_job","`","or",":","meth",":","`",".Batch.new_bash_job","`","instead","."]
docstr: Set the job's command to execute.
  
  Examples
  --------
  
  Simple job with no output files:
  
  >>> b = Batch()
  >>> j = b.new_job()
  >>> j.command(f'echo "hello"')
  >>> b.run()
  
  Simple job with one temporary file `j.ofile` that is written to a
  permanent location:
  
  >>> b = Batch()
  >>> j = b.new_job()
  >>> j.command(f'echo "hello world" > {j.ofile}')
  >>> b.write_output(j.ofile, 'output/hello.txt')
  >>> b.run()
  
  Two jobs with a file interdependency:
  
  >>> b = Batch()
  >>> j1 = b.new_job()
  >>> j1.command(f'echo "hello" > {j1.ofile}')
  >>> j2 = b.new_bash_job()
  >>> j2.command(f'cat {j1.ofile} > {j2.ofile}')
  >>> b.write_output(j2.ofile, 'output/cat_output.txt')
  >>> b.run()
  
  Specify multiple commands in the same job:
  
  >>> b = Batch()
  >>> t = b.new_job()
  >>> j.command(f'echo "hello" > {j.tmp1}')
  >>> j.command(f'echo "world" > {j.tmp2}')
  >>> j.command(f'echo "!" > {j.tmp3}')
  >>> j.command(f'cat {j.tmp1} {j.tmp2} {j.tmp3} > {j.ofile}')
  >>> b.write_output(j.ofile, 'output/concatenated.txt')
  >>> b.run()
  
  Notes
  -----
  This method can be called more than once. It's behavior is to append
  commands to run to the set of previously defined commands rather than
  overriding an existing command.
  
  To declare a resource file of type :class:`.JobResourceFile`, use either
  the get attribute syntax of `job.{identifier}` or the get item syntax of
  `job['identifier']`. If an object for that identifier doesn't exist,
  then one will be created automatically (only allowed in the
  :meth:`.command` method). The identifier name can be any valid Python
  identifier such as `ofile5000`.
  
  All :class:`.JobResourceFile` are temporary files and must be written to
  a permanent location using :meth:`.Batch.write_output` if the output
  needs to be saved.
  
  Only resources can be referred to in commands. Referencing a
  :class:`.batch.Batch` or :class:`.Job` will result in an error.
  
  Parameters
  ----------
  command:
      A ``bash`` command.
  
  Returns
  -------
  Same job object with command appended.
docstr_tok: ["Set","the","job","'s","command","to","execute",".","Examples","--","--","--","--","Simple","job","with","no","output","files",":",">",">",">","b","=","Batch","(",")",">",">",">","j","=","b.new_job","(",")",">",">",">","j.command","(","f'echo","``","hello","''","'",")",">",">",">","b.run","(",")","Simple","job","with","one","temporary","file","`","j.ofile","`","that","is","written","to","a","permanent","location",":",">",">",">","b","=","Batch","(",")",">",">",">","j","=","b.new_job","(",")",">",">",">","j.command","(","f'echo","``","hello","world","''",">","{","j.ofile","}","'",")",">",">",">","b.write_output","(","j.ofile",",","'output\/hello.txt","'",")",">",">",">","b.run","(",")","Two","jobs","with","a","file","interdependency",":",">",">",">","b","=","Batch","(",")",">",">",">","j1","=","b.new_job","(",")",">",">",">","j1.command","(","f'echo","``","hello","''",">","{","j1.ofile","}","'",")",">",">",">","j2","=","b.new_bash_job","(",")",">",">",">","j2.command","(","f'cat","{","j1.ofile","}",">","{","j2.ofile","}","'",")",">",">",">","b.write_output","(","j2.ofile",",","'output\/cat_output.txt","'",")",">",">",">","b.run","(",")","Specify","multiple","commands","in","the","same","job",":",">",">",">","b","=","Batch","(",")",">",">",">","t","=","b.new_job","(",")",">",">",">","j.command","(","f'echo","``","hello","''",">","{","j.tmp1","}","'",")",">",">",">","j.command","(","f'echo","``","world","''",">","{","j.tmp2","}","'",")",">",">",">","j.command","(","f'echo","``","!","''",">","{","j.tmp3","}","'",")",">",">",">","j.command","(","f'cat","{","j.tmp1","}","{","j.tmp2","}","{","j.tmp3","}",">","{","j.ofile","}","'",")",">",">",">","b.write_output","(","j.ofile",",","'output\/concatenated.txt","'",")",">",">",">","b.run","(",")","Notes","--","--","-","This","method","can","be","called","more","than","once",".","It","'s","behavior","is","to","append","commands","to","run","to","the","set","of","previously","defined","commands","rather","than","overriding","an","existing","command",".","To","declare","a","resource","file","of","type",":","class",":","`",".JobResourceFile","`",",","use","either","the","get","attribute","syntax","of","`","job",".","{","identifier","}","`","or","the","get","item","syntax","of","`","job","[","'identifier","'","]","`",".","If","an","object","for","that","identifier","does","n't","exist",",","then","one","will","be","created","automatically","(","only","allowed","in","the",":","meth",":","`",".command","`","method",")",".","The","identifier","name","can","be","any","valid","Python","identifier","such","as","`","ofile5000","`",".","All",":","class",":","`",".JobResourceFile","`","are","temporary","files","and","must","be","written","to","a","permanent","location","using",":","meth",":","`",".Batch.write_output","`","if","the","output","needs","to","be","saved",".","Only","resources","can","be","referred","to","in","commands",".","Referencing","a",":","class",":","`",".batch.Batch","`","or",":","class",":","`",".Job","`","will","result","in","an","error",".","Parameters","--","--","--","--","--","command",":","A","``","bash","``","command",".","Returns","--","--","--","-","Same","job","object","with","command","appended","."]
code: def command(self, command: str) -> "BashJob":
      """Set the job's command to execute.
  
      Examples
      --------
  
      Simple job with no output files:
  
      >>> b = Batch()
      >>> j = b.new_job()
      >>> j.command(f'echo "hello"')
      >>> b.run()
  
      Simple job with one temporary file `j.ofile` that is written to a
      permanent location:
  
      >>> b = Batch()
      >>> j = b.new_job()
      >>> j.command(f'echo "hello world" > {j.ofile}')
      >>> b.write_output(j.ofile, 'output/hello.txt')
      >>> b.run()
  
      Two jobs with a file interdependency:
  
      >>> b = Batch()
      >>> j1 = b.new_job()
      >>> j1.command(f'echo "hello" > {j1.ofile}')
      >>> j2 = b.new_bash_job()
      >>> j2.command(f'cat {j1.ofile} > {j2.ofile}')
      >>> b.write_output(j2.ofile, 'output/cat_output.txt')
      >>> b.run()
  
      Specify multiple commands in the same job:
  
      >>> b = Batch()
      >>> t = b.new_job()
      >>> j.command(f'echo "hello" > {j.tmp1}')
      >>> j.command(f'echo "world" > {j.tmp2}')
      >>> j.command(f'echo "!" > {j.tmp3}')
      >>> j.command(f'cat {j.tmp1} {j.tmp2} {j.tmp3} > {j.ofile}')
      >>> b.write_output(j.ofile, 'output/concatenated.txt')
      >>> b.run()
  
      Notes
      -----
      This method can be called more than once. It's behavior is to append
      commands to run to the set of previously defined commands rather than
      overriding an existing command.
  
      To declare a resource file of type :class:`.JobResourceFile`, use either
      the get attribute syntax of `job.{identifier}` or the get item syntax of
      `job['identifier']`. If an object for that identifier doesn't exist,
      then one will be created automatically (only allowed in the
      :meth:`.command` method). The identifier name can be any valid Python
      identifier such as `ofile5000`.
  
      All :class:`.JobResourceFile` are temporary files and must be written to
      a permanent location using :meth:`.Batch.write_output` if the output
      needs to be saved.
  
      Only resources can be referred to in commands. Referencing a
      :class:`.batch.Batch` or :class:`.Job` will result in an error.
  
      Parameters
      ----------
      command:
          A ``bash`` command.
  
      Returns
      -------
      Same job object with command appended.
      """
  
      command = self._interpolate_command(command)
      self._command.append(command)
      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 4 for calling the BashJob obj's underlying member method code with example usage: obj.command(command) and returns: self