# Path: proto/marshal/collections/maps.py
# class MapComposite(collections.abc.MutableMapping):
#     def _pb_type(self):
#     def __init__(self, sequence, *, marshal):
#     def __contains__(self, key):
#     def __getitem__(self, key):
#     def __setitem__(self, key, value):
#     def __delitem__(self, key):
#     def __len__(self):
#     def __iter__(self):
#     def pb(self):
# 
# Path: proto/marshal/collections/repeated.py
# class Repeated(collections.abc.MutableSequence):
# class RepeatedComposite(Repeated):
#     def __init__(self, sequence, *, marshal, proto_type=None):
#     def __copy__(self):
#     def __delitem__(self, key):
#     def __eq__(self, other):
#     def __getitem__(self, key):
#     def __len__(self):
#     def __ne__(self, other):
#     def __repr__(self):
#     def __setitem__(self, key, value):
#     def insert(self, index: int, value):
#     def sort(self, *, key: str = None, reverse: bool = False):
#     def pb(self):
#     def _pb_type(self):
#     def __eq__(self, other):
#     def __getitem__(self, key):
#     def __setitem__(self, key, value):
#     def insert(self, index: int, value):


import collections.abc
from google.protobuf import struct_pb2
from proto.marshal.collections import maps
from proto.marshal.collections import repeated
        if isinstance(value, collections.abc.Sequence):
            return struct_pb2.Value(
                list_value=self._marshal.to_proto(struct_pb2.ListValue, value),
            )
        if isinstance(value, collections.abc.Mapping):
            return struct_pb2.Value(
                struct_value=self._marshal.to_proto(struct_pb2.Struct, value),
            )
        raise ValueError("Unable to coerce value: %r" % value)


class ListValueRule:
    """A rule translating google.protobuf.ListValue and list-like objects."""

    def __init__(self, *, marshal):
        self._marshal = marshal

    def to_python(self, value, *, absent: bool = None):
        """Coerce the given value to a Python sequence."""
        return (
            None
            if absent
            else repeated.RepeatedComposite(value.values, marshal=self._marshal)
        )

    def to_proto(self, value) -> struct_pb2.ListValue:
        # We got a proto, or else something we sent originally.
        # Preserve the instance we have.
        if isinstance(value, struct_pb2.ListValue):
            return value

# Path: proto/marshal/collections/maps.py
# class MapComposite(collections.abc.MutableMapping):
#     def _pb_type(self):
#     def __init__(self, sequence, *, marshal):
#     def __contains__(self, key):
#     def __getitem__(self, key):
#     def __setitem__(self, key, value):
#     def __delitem__(self, key):
#     def __len__(self):
#     def __iter__(self):
#     def pb(self):
# 
# Path: proto/marshal/collections/repeated.py
# class Repeated(collections.abc.MutableSequence):
# class RepeatedComposite(Repeated):
#     def __init__(self, sequence, *, marshal, proto_type=None):
#     def __copy__(self):
#     def __delitem__(self, key):
#     def __eq__(self, other):
#     def __getitem__(self, key):
#     def __len__(self):
#     def __ne__(self, other):
#     def __repr__(self):
#     def __setitem__(self, key, value):
#     def insert(self, index: int, value):
#     def sort(self, *, key: str = None, reverse: bool = False):
#     def pb(self):
#     def _pb_type(self):
#     def __eq__(self, other):
#     def __getitem__(self, key):
#     def __setitem__(self, key, value):
#     def insert(self, index: int, value):


# Path: proto/marshal/rules/struct.py
import collections.abc
from google.protobuf import struct_pb2
from proto.marshal.collections import maps
from proto.marshal.collections import repeated

        if isinstance(value, collections.abc.Sequence):
            return struct_pb2.Value(
                list_value=self._marshal.to_proto(struct_pb2.ListValue, value),
            )
        if isinstance(value, collections.abc.Mapping):
            return struct_pb2.Value(
                struct_value=self._marshal.to_proto(struct_pb2.Struct, value),
            )
        raise ValueError("Unable to coerce value: %r" % value)


class ListValueRule:
    """A rule translating google.protobuf.ListValue and list-like objects."""

    def __init__(self, *, marshal):
        self._marshal = marshal

    def to_python(self, value, *, absent: bool = None):
        """Coerce the given value to a Python sequence."""
        return (
            None
            if absent
            else repeated.RepeatedComposite(value.values, marshal=self._marshal)
        )

    def to_proto(self, value) -> struct_pb2.ListValue:
        # We got a proto, or else something we sent originally.
        # Preserve the instance we have.
        if isinstance(value, struct_pb2.ListValue):
            return value

        if isinstance(value, repeated.RepeatedComposite):