<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def writeout(ds, outfn):
 """Write ds to disk Note: Depreciated function - use diskwarp functions when writing to disk to avoid unnecessary CreateCopy """

    print("Writing out %s" % outfn) 
    #Use outfn extension to get driver
    #This may have issues if outfn already exists and the mem ds has different dimensions/res
    out_ds = iolib.gtif_drv.CreateCopy(outfn, ds, 0, options=iolib.gdal_opt)
    out_ds = None