def tgrep_compile(tgrep_string):
 parser = _build_tgrep_parser(True)
 if isinstance(tgrep_string, binary_type):
  tgrep_string = tgrep_string.decode()
 return list(parser.parseString(tgrep_string, parseAll=True))[0]

def tgrep_compile ( tgrep_string ) : parser = _build_tgrep_parser ( True ) if isinstance ( tgrep_string , binary_type ) : tgrep_string = tgrep_string . decode ( ) return list ( parser . parseString ( tgrep_string , parseAll = True ) ) [ 0 ]
parses a tgrep search string into a lambda function .