<s> from __future__ import absolute_import , print_function <EOL> import itertools <EOL> from . . import cli , cluster <EOL> parser = cli . parser ( <EOL> description = "<STR_LIT>" <EOL> ) <EOL> parser . task_argument ( ) <EOL> parser . file_argument ( ) <EOL> parser . add_argument ( <EOL> "<STR_LIT>" , "<STR_LIT>" , action = "<STR_LIT:store_true>" , <EOL> help = "<STR_LIT>" <EOL> ) <EOL> parser . add_argument ( <EOL> '<STR_LIT>' , default = <NUM_LIT:10> , type = int , <EOL> help = "<STR_LIT>" <EOL> ) <EOL> parser . enable_print_header ( ) <EOL> @ cli . init ( parser ) <EOL> def main ( args ) : <EOL> def read_file ( fobj ) : <EOL> return ( str ( fobj ) , list ( itertools . islice ( fobj , args . n ) ) ) <EOL> for ( fname , lines ) in cluster . files ( <EOL> read_file , <EOL> args . task , <EOL> args . file , <EOL> active_only = not args . inactive ) : <EOL> cli . output_file ( lines , not args . q , key = fname ) </s>
