<s> import os <EOL> from osgeo import gdal <EOL> os . chdir ( r'<STR_LIT>' ) <EOL> in_ds = gdal . Open ( '<STR_LIT>' ) <EOL> in_band = in_ds . GetRasterBand ( <NUM_LIT:1> ) <EOL> out_rows = in_band . YSize * <NUM_LIT:2> <EOL> out_columns = in_band . XSize * <NUM_LIT:2> <EOL> gtiff_driver = gdal . GetDriverByName ( '<STR_LIT>' ) <EOL> out_ds = gtiff_driver . Create ( '<STR_LIT>' , <EOL> out_columns , out_rows ) <EOL> out_ds . SetProjection ( in_ds . GetProjection ( ) ) <EOL> geotransform = list ( in_ds . GetGeoTransform ( ) ) <EOL> geotransform [ <NUM_LIT:1> ] /= <NUM_LIT:2> <EOL> geotransform [ <NUM_LIT:5> ] /= <NUM_LIT:2> <EOL> out_ds . SetGeoTransform ( geotransform ) <EOL> data = in_band . ReadAsArray ( <EOL> buf_xsize = out_columns , buf_ysize = out_rows ) <EOL> out_band = out_ds . GetRasterBand ( <NUM_LIT:1> ) <EOL> out_band . WriteArray ( data ) <EOL> out_band . FlushCache ( ) <EOL> out_band . ComputeStatistics ( False ) <EOL> out_ds . BuildOverviews ( '<STR_LIT>' , [ <NUM_LIT:2> , <NUM_LIT:4> , <NUM_LIT:8> , <NUM_LIT:16> , <NUM_LIT:32> , <NUM_LIT:64> ] ) <EOL> del out_ds </s>
