<s> import os <EOL> from osgeo import gdal <EOL> os . chdir ( r'<STR_LIT>' ) <EOL> ds = gdal . Open ( '<STR_LIT>' ) <EOL> band = ds . GetRasterBand ( <NUM_LIT:1> ) <EOL> band . SetNoDataValue ( - <NUM_LIT:1> ) <EOL> rat = gdal . RasterAttributeTable ( ) <EOL> rat . CreateColumn ( '<STR_LIT>' , gdal . GFT_Integer , gdal . GFU_Name ) <EOL> rat . CreateColumn ( '<STR_LIT>' , gdal . GFT_Integer , gdal . GFU_PixelCount ) <EOL> rat . CreateColumn ( '<STR_LIT>' , gdal . GFT_String , gdal . GFU_Generic ) <EOL> rat . SetRowCount ( <NUM_LIT:6> ) <EOL> rat . WriteArray ( range ( <NUM_LIT:6> ) , <NUM_LIT:0> ) <EOL> rat . WriteArray ( band . GetHistogram ( - <NUM_LIT:0.5> , <NUM_LIT> , <NUM_LIT:6> , False , False ) , <NUM_LIT:1> ) <EOL> rat . SetValueAsString ( <NUM_LIT:1> , <NUM_LIT:2> , '<STR_LIT>' ) <EOL> rat . SetValueAsString ( <NUM_LIT:2> , <NUM_LIT:2> , '<STR_LIT>' ) <EOL> rat . SetValueAsString ( <NUM_LIT:3> , <NUM_LIT:2> , '<STR_LIT>' ) <EOL> rat . SetValueAsString ( <NUM_LIT:4> , <NUM_LIT:2> , '<STR_LIT>' ) <EOL> rat . SetValueAsString ( <NUM_LIT:5> , <NUM_LIT:2> , '<STR_LIT>' ) <EOL> band . SetDefaultRAT ( rat ) <EOL> band . SetNoDataValue ( <NUM_LIT:0> ) <EOL> del ds </s>
