<s> """<STR_LIT>""" <EOL> import sys <EOL> from flocker . testtools import extract_eliot_from_twisted_log <EOL> def chain_files ( paths ) : <EOL> """<STR_LIT>""" <EOL> for path in paths : <EOL> with open ( path , '<STR_LIT:r>' ) as f : <EOL> for line in f : <EOL> yield line <EOL> def process_line ( line ) : <EOL> eliot_line = extract_eliot_from_twisted_log ( line ) <EOL> if eliot_line : <EOL> yield eliot_line <EOL> yield '<STR_LIT:\n>' <EOL> def filter_eliot_main ( args , base_path , top_level , stdin = None , stdout = None ) : <EOL> """<STR_LIT>""" <EOL> stdin = sys . stdin if stdin is None else stdin <EOL> stdout = sys . stdout if stdout is None else stdout <EOL> if args : <EOL> lines = chain_files ( args ) <EOL> else : <EOL> lines = stdin <EOL> for line in lines : <EOL> for output in process_line ( line ) : <EOL> stdout . write ( output ) </s>
