@decorator
def pb(f, *args, **kwargs):
 msg = f(*args, **kwargs)
 return msg.SerializeToString()

@ decorator def pb ( f , * args , ** kwargs ) : msg = f ( * args , ** kwargs ) return msg . SerializeToString ( )
decorator to serialize a protobuf message .