docs: 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()