def ConvertToWireFormat(self, value):
    data = value.SerializeToString()
    any_value = AnyValue(type_url=value.__class__.__name__, value=data)
    output = SerializeEntries(any_value.GetRawData().itervalues())

    return (self.encoded_tag, VarintEncode(len(output)), output)
Encode the nested protobuf into wire format.
dataset/ETHPy150Open google/grr/grr/lib/rdfvalues/structs.py/ProtoDynamicAnyValueEmbedded.ConvertToWireFormat