def cuckoo_analysis(target, options):
 submit_job(target, options)
 def read_cuckoo_output():
  return CuckooTests.cuckoo.stderr.readline().rstrip()
 def is_completion(line):
  return (None != re.search('.*Task #[0-9]{3}: analysis .* completed', line))
 def is_error(line):
  if (re.search('.*ERROR: Analysis failed:', line) != None):
   raise Exception('Cuckoo analysis failed')
 line = read_cuckoo_output()
 while ((not is_completion(line)) and (not is_error(line))):
  line = read_cuckoo_output()
 return latest_analysis_results()

def cuckoo_analysis ( target , options ) : submit_job ( target , options ) def read_cuckoo_output ( ) : return CuckooTests . cuckoo . stderr . readline ( ) . rstrip ( ) def is_completion ( line ) : return ( None != re . search ( '.*Task #[0-9]{3}: analysis .* completed' , line ) ) def is_error ( line ) : if ( re . search ( '.*ERROR: Analysis failed:' , line ) != None ) : raise Exception ( 'Cuckoo analysis failed' ) line = read_cuckoo_output ( ) while ( ( not is_completion ( line ) ) and ( not is_error ( line ) ) ) : line = read_cuckoo_output ( ) return latest_analysis_results ( )
returns a dictionary with the following keys: :report => dictionary contents of report .