<s> import sys , json <EOL> preamble = r'''<STR_LIT>''' <EOL> postscript = '''<STR_LIT>''' <EOL> class_method_template = '''<STR_LIT>''' <EOL> object_method_template = '''<STR_LIT>''' <EOL> app_object_method_template = '''<STR_LIT>''' <EOL> print preamble <EOL> for method in json . loads ( sys . stdin . read ( ) ) : <EOL> route , signature , opts = method <EOL> method_name = signature . split ( "<STR_LIT:(>" ) [ <NUM_LIT:0> ] <EOL> retry = "<STR_LIT:true>" if ( opts [ '<STR_LIT>' ] ) else "<STR_LIT:false>" <EOL> if ( opts [ '<STR_LIT>' ] ) : <EOL> root , oid_route , method_route = route . split ( "<STR_LIT:/>" ) <EOL> if oid_route == '<STR_LIT>' : <EOL> print app_object_method_template . format ( method_name = method_name , to_retry = retry , method_route = method_route ) <EOL> else : <EOL> print object_method_template . format ( method_name = method_name , to_retry = retry , method_route = method_route ) <EOL> else : <EOL> print class_method_template . format ( method_name = method_name , to_retry = retry , route = route ) <EOL> print postscript </s>
