class_docstr: Class representing an intermediate file from a job.
  
  Examples
  --------
  `j.ofile` is a :class:`.JobResourceFile` on the job`j`:
  
  >>> b = Batch()
  >>> j = b.new_job(name='hello-tmp')
  >>> j.command(f'echo "hello world" > {j.ofile}')
  >>> b.run()
  
  Notes
  -----
  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.
class_docstr_tok: ["Class","representing","an","intermediate","file","from","a","job",".","Examples","--","--","--","--","`","j.ofile","`","is","a",":","class",":","`",".JobResourceFile","`","on","the","job","`","j","`",":",">",">",">","b","=","Batch","(",")",">",">",">","j","=","b.new_job","(","name='hello-tmp","'",")",">",">",">","j.command","(","f'echo","``","hello","world","''",">","{","j.ofile","}","'",")",">",">",">","b.run","(",")","Notes","--","--","-","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","."]
docstr: Specify the file extension to use.
  
  Examples
  --------
  
  >>> b = Batch()
  >>> j = b.new_job()
  >>> j.command(f'echo "hello" > {j.ofile}')
  >>> j.ofile.add_extension('.txt')
  >>> b.run()
  
  Notes
  -----
  The default file name for a :class:`.JobResourceFile` is the name
  of the identifier.
  
  Parameters
  ----------
  extension: :obj:`str`
      File extension to use.
  
  Returns
  -------
  :class:`.JobResourceFile`
      Same resource file with the extension specified
code: def add_extension(self, extension: str) -> "JobResourceFile":
      """
      Specify the file extension to use.
  
      Examples
      --------
  
      >>> b = Batch()
      >>> j = b.new_job()
      >>> j.command(f'echo "hello" > {j.ofile}')
      >>> j.ofile.add_extension('.txt')
      >>> b.run()
  
      Notes
      -----
      The default file name for a :class:`.JobResourceFile` is the name
      of the identifier.
  
      Parameters
      ----------
      extension: :obj:`str`
          File extension to use.
  
      Returns
      -------
      :class:`.JobResourceFile`
          Same resource file with the extension specified
      """
      if self._has_extension:
          raise BatchException(
              "Resource already has a file extension added."
          )
      assert self._value is not None
      self._value += extension
      self._has_extension = True
      return self
  
imports: import abc
  from typing import Optional, Set, cast, Union
  from .None import job
  from .exceptions import BatchException
label_desc: Use image node_id 4 for calling the JobResourceFile obj's underlying member method code with example usage: obj.add_extension(extension) and returns: self