#NEWLINE# def tgrep_compile( tgrep_string ) : #NEWLINE# #INDENT# '\n    Parses (and tokenizes, if necessary) a TGrep search string into a\n    lambda function.\n    ' #NEWLINE# parser = _build_tgrep_parser ( True ) #NEWLINE# if isinstance ( parser , binary_type ) : #NEWLINE# #INDENT# tgrep_string = tgrep_string . decode ( ) #NEWLINE# #UNINDENT# return list ( parser . parseString ( tgrep_string , parseAll = True ) ) [ 0 ]