<s> """<STR_LIT>""" <EOL> import logging <EOL> import sys <EOL> from optparse import OptionParser <EOL> from textwrap import wrap <EOL> import github2 . client <EOL> PY3K = sys . version_info [ <NUM_LIT:0> ] == <NUM_LIT:3> and True or False <EOL> def print_ ( text ) : <EOL> """<STR_LIT>""" <EOL> if PY3K : <EOL> print ( text ) <EOL> else : <EOL> sys . stdout . write ( text + '<STR_LIT:\n>' ) <EOL> def parse_commandline ( ) : <EOL> """<STR_LIT>""" <EOL> parser = OptionParser ( ) <EOL> parser . description = __doc__ <EOL> parser . set_usage ( '<STR_LIT>' ) <EOL> parser . add_option ( '<STR_LIT>' , '<STR_LIT>' , action = '<STR_LIT:store_true>' , <EOL> help = '<STR_LIT>' ) <EOL> parser . add_option ( '<STR_LIT:-c>' , '<STR_LIT>' , default = None , <EOL> help = '<STR_LIT>' ) <EOL> options , args = parser . parse_args ( ) <EOL> if len ( args ) != <NUM_LIT:1> : <EOL> parser . error ( '<STR_LIT>' ) <EOL> return options , args [ <NUM_LIT:0> ] <EOL> def main ( ) : <EOL> """<STR_LIT>""" <EOL> return_value = <NUM_LIT:0> <EOL> options , term = parse_commandline ( ) <EOL> github = github2 . client . Github ( cache = options . cache ) <EOL> logging . basicConfig ( level = options . debug and logging . DEBUG or logging . WARN , <EOL> format = "<STR_LIT>" , <EOL> datefmt = "<STR_LIT>" ) <EOL> repos = github . repos . search ( term ) <EOL> if not repos : <EOL> print_ ( '<STR_LIT>' ) <EOL> return_value = <NUM_LIT:255> <EOL> else : <EOL> for repo in repos : <EOL> print ( repo . project ) <EOL> if repo . description : <EOL> print_ ( '<STR_LIT:\n>' . join ( wrap ( repo . description , initial_indent = '<STR_LIT:U+0020>' , <EOL> subsequent_indent = '<STR_LIT:U+0020>' ) ) ) <EOL> logging . shutdown ( ) <EOL> return return_value <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> sys . exit ( main ( ) ) </s>
