<s> """<STR_LIT>""" <EOL> import markdown <EOL> import sys <EOL> import optparse <EOL> import logging <EOL> from logging import DEBUG , INFO , WARN , ERROR , CRITICAL <EOL> COMMAND_LINE_LOGGING_LEVEL = CRITICAL <EOL> def parse_options ( ) : <EOL> """<STR_LIT>""" <EOL> usage = """<STR_LIT>""" <EOL> desc = "<STR_LIT>" "<STR_LIT>" <EOL> ver = "<STR_LIT>" % markdown . version <EOL> parser = optparse . OptionParser ( usage = usage , description = desc , version = ver ) <EOL> parser . add_option ( "<STR_LIT>" , "<STR_LIT>" , dest = "<STR_LIT:filename>" , default = sys . stdout , <EOL> help = "<STR_LIT>" , <EOL> metavar = "<STR_LIT>" ) <EOL> parser . add_option ( "<STR_LIT>" , "<STR_LIT>" , dest = "<STR_LIT>" , <EOL> help = "<STR_LIT>" , ) <EOL> parser . add_option ( "<STR_LIT>" , "<STR_LIT>" , default = CRITICAL , <EOL> action = "<STR_LIT>" , const = CRITICAL + <NUM_LIT:10> , dest = "<STR_LIT>" , <EOL> help = "<STR_LIT>" ) <EOL> parser . add_option ( "<STR_LIT>" , "<STR_LIT>" , <EOL> action = "<STR_LIT>" , const = INFO , dest = "<STR_LIT>" , <EOL> help = "<STR_LIT>" ) <EOL> parser . add_option ( "<STR_LIT>" , "<STR_LIT>" , dest = "<STR_LIT>" , default = False , <EOL> metavar = "<STR_LIT>" , <EOL> help = "<STR_LIT>" ) <EOL> parser . add_option ( "<STR_LIT>" , "<STR_LIT>" , dest = "<STR_LIT>" , <EOL> default = '<STR_LIT>' , metavar = "<STR_LIT>" , <EOL> help = "<STR_LIT>" ) <EOL> parser . add_option ( "<STR_LIT>" , <EOL> action = "<STR_LIT>" , const = DEBUG , dest = "<STR_LIT>" , <EOL> help = "<STR_LIT>" ) <EOL> parser . add_option ( "<STR_LIT>" , "<STR_LIT>" , action = "<STR_LIT>" , dest = "<STR_LIT>" , <EOL> help = "<STR_LIT>" , metavar = "<STR_LIT>" ) <EOL> ( options , args ) = parser . parse_args ( ) <EOL> if len ( args ) == <NUM_LIT:0> : <EOL> input_file = sys . stdin <EOL> else : <EOL> input_file = args [ <NUM_LIT:0> ] <EOL> if not options . extensions : <EOL> options . extensions = [ ] <EOL> return { '<STR_LIT:input>' : input_file , <EOL> '<STR_LIT>' : options . filename , <EOL> '<STR_LIT>' : options . safe , <EOL> '<STR_LIT>' : options . extensions , <EOL> '<STR_LIT>' : options . encoding , <EOL> '<STR_LIT>' : options . output_format } , options . verbose <EOL> def run ( ) : <EOL> """<STR_LIT>""" <EOL> options , logging_level = parse_options ( ) <EOL> if not options : sys . exit ( <NUM_LIT:0> ) <EOL> if logging_level : logging . getLogger ( '<STR_LIT>' ) . setLevel ( logging_level ) <EOL> markdown . markdownFromFile ( ** options ) </s>
