<s> import agate <EOL> from csvkit . cli import CSVKitUtility <EOL> class CSVFormat ( CSVKitUtility ) : <EOL> description = '<STR_LIT>' <EOL> override_flags = [ '<STR_LIT:l>' , '<STR_LIT>' , '<STR_LIT:H>' ] <EOL> def add_arguments ( self ) : <EOL> self . argparser . add_argument ( '<STR_LIT>' , '<STR_LIT>' , dest = '<STR_LIT>' , <EOL> help = '<STR_LIT>' ) <EOL> self . argparser . add_argument ( '<STR_LIT>' , '<STR_LIT>' , dest = '<STR_LIT>' , action = '<STR_LIT:store_true>' , <EOL> help = '<STR_LIT>' ) <EOL> self . argparser . add_argument ( '<STR_LIT>' , '<STR_LIT>' , dest = '<STR_LIT>' , <EOL> help = '<STR_LIT>' ) <EOL> self . argparser . add_argument ( '<STR_LIT>' , '<STR_LIT>' , dest = '<STR_LIT>' , type = int , choices = [ <NUM_LIT:0> , <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:3> ] , <EOL> help = '<STR_LIT>' ) <EOL> self . argparser . add_argument ( '<STR_LIT>' , '<STR_LIT>' , dest = '<STR_LIT>' , action = '<STR_LIT>' , <EOL> help = '<STR_LIT>' ) <EOL> self . argparser . add_argument ( '<STR_LIT>' , '<STR_LIT>' , dest = '<STR_LIT>' , <EOL> help = '<STR_LIT>' ) <EOL> self . argparser . add_argument ( '<STR_LIT>' , '<STR_LIT>' , dest = '<STR_LIT>' , <EOL> help = '<STR_LIT>' ) <EOL> def _extract_csv_writer_kwargs ( self ) : <EOL> kwargs = { } <EOL> if self . args . out_tabs : <EOL> kwargs [ '<STR_LIT>' ] = '<STR_LIT:\t>' <EOL> elif self . args . out_delimiter : <EOL> kwargs [ '<STR_LIT>' ] = self . args . out_delimiter <EOL> for arg in ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) : <EOL> value = getattr ( self . args , '<STR_LIT>' % arg ) <EOL> if value is not None : <EOL> kwargs [ arg ] = value <EOL> return kwargs <EOL> def main ( self ) : <EOL> reader = agate . csv . reader ( self . input_file , ** self . reader_kwargs ) <EOL> writer = agate . csv . writer ( self . output_file , ** self . writer_kwargs ) <EOL> writer . writerows ( reader ) <EOL> def launch_new_instance ( ) : <EOL> utility = CSVFormat ( ) <EOL> utility . main ( ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> launch_new_instance ( ) </s>
