<s> __author__ = '<STR_LIT>' <EOL> from gdata import service <EOL> import gdata . codesearch . service <EOL> import gdata <EOL> import atom <EOL> import getopt <EOL> import sys <EOL> class CodesearchExample : <EOL> def __init__ ( self ) : <EOL> """<STR_LIT>""" <EOL> self . service = gdata . codesearch . service . CodesearchService ( <EOL> source = '<STR_LIT>' ) <EOL> def PrintCodeSnippets ( self , query ) : <EOL> """<STR_LIT>""" <EOL> feed = self . service . GetSnippetsFeed ( query ) <EOL> print feed . title . text + "<STR_LIT>" + query + "<STR_LIT:'>" <EOL> print '<STR_LIT>' <EOL> for entry in feed . entry : <EOL> print "<STR_LIT>" + entry . title . text <EOL> for match in entry . match : <EOL> print "<STR_LIT>" + match . line_number + "<STR_LIT::>" + match . text . replace ( '<STR_LIT:\n>' , '<STR_LIT>' ) <EOL> print <EOL> def main ( ) : <EOL> """<STR_LIT>""" <EOL> try : <EOL> opts , args = getopt . getopt ( sys . argv [ <NUM_LIT:1> : ] , "<STR_LIT>" , [ "<STR_LIT>" ] ) <EOL> except getopt . error , msg : <EOL> print ( '<STR_LIT>' ) <EOL> sys . exit ( <NUM_LIT:2> ) <EOL> query = '<STR_LIT>' <EOL> for o , a in opts : <EOL> if o == "<STR_LIT>" : <EOL> query = a <EOL> if query == '<STR_LIT>' : <EOL> print ( '<STR_LIT>' ) <EOL> sys . exit ( <NUM_LIT:2> ) <EOL> sample = CodesearchExample ( ) <EOL> sample . PrintCodeSnippets ( query ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> main ( ) </s>
