code: def diskwarp(src_ds, res=None, extent=None, t_srs=None, r='cubic', outdir=None, dst_fn=None, dst_ndv=None, verbose=True):
      
      if dst_fn is None:
          dst_fn = os.path.splitext(src_ds.GetFileList()[0])[0]+'_warp.tif'
      if outdir is not None:
          dst_fn = os.path.join(outdir, os.path.basename(dst_fn))  
      driver = iolib.gtif_drv
      dst_ds = warp(src_ds, res, extent, t_srs, r, driver, dst_fn, dst_ndv=dst_ndv, verbose=verbose)
      #Write out
      dst_ds = None
      #Now reopen ds from disk
      dst_ds = gdal.Open(dst_fn)
      return dst_ds
docs: Helper function that calls warp for single input Dataset with output to disk (GDAL GeoTiff Driver)