#NEWLINE# def pack_apply_message( f , args , kwargs , threshold = 6.4e-05 ) : #NEWLINE# #INDENT# 'pack up a function, args, and kwargs to be sent over the wire\n    as a series of buffers. Any object whose data is larger than `threshold`\n    will not have their data copied (currently only numpy arrays support zero-copy)' #NEWLINE# msg = [ pickle . dumps ( can ( f ) , ( - 1 ) ) ] #NEWLINE# databuffers = [ ] #NEWLINE# ( sargs , bufs ) = serialize_object ( args , threshold ) #NEWLINE# msg . append ( sargs ) #NEWLINE# databuffers . extend ( bufs ) #NEWLINE# ( skwargs , bufs ) = serialize_object ( kwargs , threshold ) #NEWLINE# msg . append ( skwargs ) #NEWLINE# databuffers . extend ( bufs ) #NEWLINE# msg . extend ( databuffers ) #NEWLINE# return msg