<s> """<STR_LIT>""" <EOL> import json <EOL> import sys <EOL> from gvcf_expander import GvcfExpander <EOL> from gvcf_expander import Pair <EOL> BIG_QUERY_SINK = True <EOL> def main ( ) : <EOL> """<STR_LIT>""" <EOL> file_handle = sys . stdin <EOL> if <NUM_LIT:2> <= len ( sys . argv ) : <EOL> file_handle = open ( sys . argv [ <NUM_LIT:1> ] , "<STR_LIT:r>" ) <EOL> expander = GvcfExpander ( bin_size = <NUM_LIT:1000> , <EOL> filter_ref_matches = False , <EOL> emit_ref_blocks = False ) <EOL> line = file_handle . readline ( ) <EOL> while line : <EOL> line = line . strip ( ) <EOL> if not line : <EOL> line = file_handle . readline ( ) <EOL> continue <EOL> ( key , value ) = line . split ( "<STR_LIT:\t>" ) <EOL> fields = json . loads ( value ) <EOL> results = expander . reduce ( pair = Pair ( key , fields ) ) <EOL> for result in results : <EOL> emit ( result ) <EOL> line = file_handle . readline ( ) <EOL> results = expander . finalize ( ) <EOL> for result in results : <EOL> emit ( result ) <EOL> def emit ( fields ) : <EOL> """<STR_LIT>""" <EOL> if BIG_QUERY_SINK : <EOL> print "<STR_LIT>" % ( json . dumps ( fields ) ) <EOL> else : <EOL> print "<STR_LIT:%s>" % ( json . dumps ( fields ) ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> main ( ) </s>
