<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def serialize(cls, **properties):
 """ With a Protobuf class and properties as keyword arguments, sets all the properties on a new instance of the class and serializes the resulting value. """

    obj = cls()
    for k, v in properties.iteritems():
        log.debug("%s.%s = %r", cls.__name__, k, v)
        setattr(obj, k, v)
    return obj.SerializeToString()