<s> '''<STR_LIT>''' <EOL> import pprint <EOL> class ViewPE ( object ) : <EOL> '''<STR_LIT>''' <EOL> dependencies = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> def execute ( self , input_data ) : <EOL> '''<STR_LIT>''' <EOL> if ( input_data [ '<STR_LIT>' ] [ '<STR_LIT>' ] != '<STR_LIT>' ) : <EOL> return { '<STR_LIT:error>' : self . __class__ . __name__ + '<STR_LIT>' + input_data [ '<STR_LIT>' ] [ '<STR_LIT>' ] } <EOL> view = { } <EOL> view [ '<STR_LIT>' ] = list ( set ( [ item [ '<STR_LIT>' ] for item in input_data [ '<STR_LIT>' ] [ '<STR_LIT>' ] ] ) ) <EOL> view [ '<STR_LIT>' ] = input_data [ '<STR_LIT>' ] [ '<STR_LIT>' ] <EOL> view [ '<STR_LIT>' ] = input_data [ '<STR_LIT>' ] [ '<STR_LIT>' ] . keys ( ) <EOL> view [ '<STR_LIT>' ] = input_data [ '<STR_LIT>' ] [ '<STR_LIT>' ] <EOL> view [ '<STR_LIT>' ] = self . safe_get ( input_data , [ '<STR_LIT>' , '<STR_LIT>' ] ) [ : <NUM_LIT:15> ] <EOL> view . update ( input_data [ '<STR_LIT>' ] ) <EOL> return view <EOL> @ staticmethod <EOL> def safe_get ( data , key_list ) : <EOL> '''<STR_LIT>''' <EOL> for key in key_list : <EOL> data = data . get ( key , { } ) <EOL> return data if data else '<STR_LIT>' <EOL> def test ( ) : <EOL> '''<STR_LIT>''' <EOL> import zerorpc <EOL> workbench = zerorpc . Client ( timeout = <NUM_LIT> , heartbeat = <NUM_LIT> ) <EOL> workbench . connect ( "<STR_LIT>" ) <EOL> import os <EOL> data_path = os . path . join ( os . path . dirname ( os . path . realpath ( __file__ ) ) , <EOL> '<STR_LIT>' ) <EOL> md5 = workbench . store_sample ( open ( data_path , '<STR_LIT:rb>' ) . read ( ) , '<STR_LIT>' , '<STR_LIT>' ) <EOL> input_data = workbench . work_request ( '<STR_LIT>' , md5 ) <EOL> input_data . update ( workbench . work_request ( '<STR_LIT>' , md5 ) ) <EOL> input_data . update ( workbench . work_request ( '<STR_LIT>' , md5 ) ) <EOL> input_data . update ( workbench . work_request ( '<STR_LIT>' , md5 ) ) <EOL> input_data . update ( workbench . work_request ( '<STR_LIT>' , md5 ) ) <EOL> input_data . update ( workbench . work_request ( '<STR_LIT>' , md5 ) ) <EOL> worker = ViewPE ( ) <EOL> output = worker . execute ( input_data ) <EOL> print '<STR_LIT>' <EOL> pprint . pprint ( output ) <EOL> output = workbench . work_request ( '<STR_LIT>' , md5 ) <EOL> print '<STR_LIT>' <EOL> pprint . pprint ( output ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> test ( ) </s>
