code: def get_output(self, job_id, outfn):
          
          job_info = self.job_info(jobid=job_id)[0]
  
          # Make sure that the job is finished.
          status = int(job_info["Status"])
          if status != 5:
              raise Exception("The status of job %d is %d (%s)"
                      %(job_id, status, self.status_codes[status]))
  
          # Try to download the output file.
          remotefn = job_info["OutputLoc"]
          r = requests.get(remotefn)
  
          # Make sure that the request went through.
          code = r.status_code
          if code != 200:
              raise Exception("Getting file %s yielded status: %d"
                      %(remotefn, code))
  
          # Save the data to a file.
          try:
              outfn.write(r.content)
          except AttributeError:
              f = open(outfn, "wb")
              f.write(r.content)
              f.close()
docs: Download an output file given the id of the output request job.
  
          ## Arguments
  
          * `job_id` (int): The id of the _output_ job.
          * `outfn` (str): The file where the output should be stored.
              May also be a file-like object with a 'write' method.