def apply_sync(func, args=(), kwds={}, callback=None):
 res = func(*args, **kwds)
 if (callback is not None):
  callback(res)

def apply_sync ( func , args = ( ) , kwds = { } , callback = None ) : res = func ( * args , ** kwds ) if ( callback is not None ) : callback ( res )
a naive synchronous version of apply_async .