<s> """<STR_LIT>""" <EOL> import sys , os , time , difflib , optparse <EOL> def main ( ) : <EOL> usage = "<STR_LIT>" <EOL> parser = optparse . OptionParser ( usage ) <EOL> parser . add_option ( "<STR_LIT:-c>" , action = "<STR_LIT:store_true>" , default = False , help = '<STR_LIT>' ) <EOL> parser . add_option ( "<STR_LIT>" , action = "<STR_LIT:store_true>" , default = False , help = '<STR_LIT>' ) <EOL> parser . add_option ( "<STR_LIT>" , action = "<STR_LIT:store_true>" , default = False , help = '<STR_LIT>' ) <EOL> parser . add_option ( "<STR_LIT>" , action = "<STR_LIT:store_true>" , default = False , help = '<STR_LIT>' ) <EOL> parser . add_option ( "<STR_LIT>" , "<STR_LIT>" , type = "<STR_LIT:int>" , default = <NUM_LIT:3> , help = '<STR_LIT>' ) <EOL> ( options , args ) = parser . parse_args ( ) <EOL> if len ( args ) == <NUM_LIT:0> : <EOL> parser . print_help ( ) <EOL> sys . exit ( <NUM_LIT:1> ) <EOL> if len ( args ) != <NUM_LIT:2> : <EOL> parser . error ( "<STR_LIT>" ) <EOL> n = options . lines <EOL> fromfile , tofile = args <EOL> fromdate = time . ctime ( os . stat ( fromfile ) . st_mtime ) <EOL> todate = time . ctime ( os . stat ( tofile ) . st_mtime ) <EOL> fromlines = open ( fromfile , '<STR_LIT>' ) . readlines ( ) <EOL> tolines = open ( tofile , '<STR_LIT>' ) . readlines ( ) <EOL> if options . u : <EOL> diff = difflib . unified_diff ( fromlines , tolines , fromfile , tofile , fromdate , todate , n = n ) <EOL> elif options . n : <EOL> diff = difflib . ndiff ( fromlines , tolines ) <EOL> elif options . m : <EOL> diff = difflib . HtmlDiff ( ) . make_file ( fromlines , tolines , fromfile , tofile , context = options . c , numlines = n ) <EOL> else : <EOL> diff = difflib . context_diff ( fromlines , tolines , fromfile , tofile , fromdate , todate , n = n ) <EOL> sys . stdout . writelines ( diff ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> main ( ) </s>
