code: def write_local_file(self, outputfile, path):
          
          self.logger.info("Writing file to %s", path)
          outputfile.seek(0)
          with open(path, 'wb') as fd:
              copyfileobj(outputfile, fd)
docs: Write file to the desired path.