def serialize_args(fn):
 def wrapper(obj, *args, **kwargs):
  args = [(utils.strtime(arg) if isinstance(arg, datetime.datetime) else arg) for arg in args]
  for (k, v) in kwargs.items():
   if ((k == 'exc_val') and v):
    kwargs[k] = six.text_type(v)
   elif ((k == 'exc_tb') and v and (not isinstance(v, six.string_types))):
    kwargs[k] = ''.join(traceback.format_tb(v))
   elif isinstance(v, datetime.datetime):
    kwargs[k] = utils.strtime(v)
  if hasattr(fn, '__call__'):
   return fn(obj, *args, **kwargs)
  return fn.__get__(None, obj)(*args, **kwargs)
 wrapper.remotable = getattr(fn, 'remotable', False)
 wrapper.original_fn = fn
 return (functools.wraps(fn)(wrapper) if hasattr(fn, '__call__') else classmethod(wrapper))

def serialize_args ( fn ) : def wrapper ( obj , * args , ** kwargs ) : args = [ ( utils . strtime ( arg ) if isinstance ( arg , datetime . datetime ) else arg ) for arg in args ] for ( k , v ) in kwargs . items ( ) : if ( ( k == 'exc_val' ) and v ) : kwargs [ k ] = six . text_type ( v ) elif ( ( k == 'exc_tb' ) and v and ( not isinstance ( v , six . string_types ) ) ) : kwargs [ k ] = '' . join ( traceback . format_tb ( v ) ) elif isinstance ( v , datetime . datetime ) : kwargs [ k ] = utils . strtime ( v ) if hasattr ( fn , '__call__' ) : return fn ( obj , * args , ** kwargs ) return fn . __get__ ( None , obj ) ( * args , ** kwargs ) wrapper . remotable = getattr ( fn , 'remotable' , False ) wrapper . original_fn = fn return ( functools . wraps ( fn ) ( wrapper ) if hasattr ( fn , '__call__' ) else classmethod ( wrapper ) )
workaround for float string conversion issues in python 2 .