<s> import json <EOL> import logging <EOL> from toolset . io import fire , run <EOL> from toolset . tool import Template <EOL> logger = logging . getLogger ( '<STR_LIT>' ) <EOL> def go ( ) : <EOL> class _Tool ( Template ) : <EOL> help = '''<STR_LIT>''' <EOL> tag = '<STR_LIT:info>' <EOL> def customize ( self , parser ) : <EOL> parser . add_argument ( '<STR_LIT>' , type = str , nargs = '<STR_LIT:*>' , default = '<STR_LIT:*>' , help = '<STR_LIT>' ) <EOL> def body ( self , args , proxy ) : <EOL> for token in args . clusters : <EOL> def _query ( zk ) : <EOL> replies = fire ( zk , token , '<STR_LIT:info>' ) <EOL> return len ( replies ) , { key : hints for key , ( _ , hints , code ) in replies . items ( ) if code == <NUM_LIT:200> } <EOL> total , js = run ( proxy , _query ) <EOL> if not total : <EOL> logger . info ( '<STR_LIT>' % token ) <EOL> else : <EOL> pct = ( len ( js ) * <NUM_LIT:100> ) / total <EOL> unrolled = [ '<STR_LIT>' % ( k , json . dumps ( js [ k ] , indent = <NUM_LIT:4> , separators = ( '<STR_LIT:U+002C>' , '<STR_LIT>' ) ) ) for k in sorted ( js . keys ( ) ) ] <EOL> logger . info ( '<STR_LIT>' % ( token , pct , total , '<STR_LIT>' . join ( unrolled ) ) ) <EOL> return _Tool ( ) </s>
