# Path: rlp/sedes/binary.py
# class Binary(object):
#     def __init__(self, min_length=None, max_length=None, allow_empty=False):
#     def fixed_length(cls, l, allow_empty=False):
#     def is_valid_type(cls, obj):
#     def is_valid_length(self, l):
#     def serialize(self, obj):
#     def deserialize(self, serial):
# 
# Path: rlp/sedes/lists.py
# class CountableList(object):
# 
#     """A sedes for lists of arbitrary length.
# 
#     :param element_sedes: when (de-)serializing a list, this sedes will be
#                           applied to all of its elements
#     :param max_length: maximum number of allowed elements, or `None` for no limit
#     """
# 
#     def __init__(self, element_sedes, max_length=None):
#         self.element_sedes = element_sedes
#         self.max_length = max_length
# 
#     @to_list
#     def serialize(self, obj):
#         if not is_sequence(obj):
#             raise ListSerializationError('Can only serialize sequences', obj)
# 
#         if self.max_length is not None and len(obj) > self.max_length:
#             raise ListSerializationError(
#                 'Too many elements ({}, allowed {})'.format(
#                     len(obj),
#                     self.max_length,
#                 ),
#                 obj=obj,
#             )
# 
#         for index, element in enumerate(obj):
#             try:
#                 yield self.element_sedes.serialize(element)
#             except SerializationError as e:
#                 raise ListSerializationError(obj=obj, element_exception=e, index=index)
# 
#     @to_tuple
#     def deserialize(self, serial):
#         if not is_sequence(serial):
#             raise ListDeserializationError('Can only deserialize sequences', serial=serial)
#         for index, element in enumerate(serial):
#             if self.max_length is not None and index >= self.max_length:
#                 raise ListDeserializationError(
#                     'Too many elements (more than {})'.format(self.max_length),
#                     serial=serial,
#                 )
# 
#             try:
#                 yield self.element_sedes.deserialize(element)
#             except DeserializationError as e:
#                 raise ListDeserializationError(serial=serial, element_exception=e, index=index)
# 
# Path: rlp/exceptions.py
# class DecodingError(RLPException):
#     """Exception raised if decoding fails.
# 
#     :ivar rlp: the RLP string that could not be decoded
#     """
# 
#     def __init__(self, message, rlp):
#         super(DecodingError, self).__init__(message)
#         self.rlp = rlp
# 
# class DeserializationError(RLPException):
#     """Exception raised if deserialization fails.
# 
#     :ivar serial: the decoded RLP string that could not be deserialized
#     """
# 
#     def __init__(self, message, serial):
#         super(DeserializationError, self).__init__(message)
#         self.serial = serial


from itertools import repeat, chain
from rlp.sedes import binary, CountableList
from rlp.exceptions import DecodingError, DeserializationError
import sys
import pytest
import rlp
    import pytest_benchmark  # noqa: F401


try:
except ImportError:
    do_benchmark = False
else:
    do_benchmark = True


# speed up setup in case tests aren't run anyway
if do_benchmark:
    SIZE = int(1e6)

# Path: rlp/sedes/binary.py
# class Binary(object):
#     def __init__(self, min_length=None, max_length=None, allow_empty=False):
#     def fixed_length(cls, l, allow_empty=False):
#     def is_valid_type(cls, obj):
#     def is_valid_length(self, l):
#     def serialize(self, obj):
#     def deserialize(self, serial):
# 
# Path: rlp/sedes/lists.py
# class CountableList(object):
# 
#     """A sedes for lists of arbitrary length.
# 
#     :param element_sedes: when (de-)serializing a list, this sedes will be
#                           applied to all of its elements
#     :param max_length: maximum number of allowed elements, or `None` for no limit
#     """
# 
#     def __init__(self, element_sedes, max_length=None):
#         self.element_sedes = element_sedes
#         self.max_length = max_length
# 
#     @to_list
#     def serialize(self, obj):
#         if not is_sequence(obj):
#             raise ListSerializationError('Can only serialize sequences', obj)
# 
#         if self.max_length is not None and len(obj) > self.max_length:
#             raise ListSerializationError(
#                 'Too many elements ({}, allowed {})'.format(
#                     len(obj),
#                     self.max_length,
#                 ),
#                 obj=obj,
#             )
# 
#         for index, element in enumerate(obj):
#             try:
#                 yield self.element_sedes.serialize(element)
#             except SerializationError as e:
#                 raise ListSerializationError(obj=obj, element_exception=e, index=index)
# 
#     @to_tuple
#     def deserialize(self, serial):
#         if not is_sequence(serial):
#             raise ListDeserializationError('Can only deserialize sequences', serial=serial)
#         for index, element in enumerate(serial):
#             if self.max_length is not None and index >= self.max_length:
#                 raise ListDeserializationError(
#                     'Too many elements (more than {})'.format(self.max_length),
#                     serial=serial,
#                 )
# 
#             try:
#                 yield self.element_sedes.deserialize(element)
#             except DeserializationError as e:
#                 raise ListDeserializationError(serial=serial, element_exception=e, index=index)
# 
# Path: rlp/exceptions.py
# class DecodingError(RLPException):
#     """Exception raised if decoding fails.
# 
#     :ivar rlp: the RLP string that could not be decoded
#     """
# 
#     def __init__(self, message, rlp):
#         super(DecodingError, self).__init__(message)
#         self.rlp = rlp
# 
# class DeserializationError(RLPException):
#     """Exception raised if deserialization fails.
# 
#     :ivar serial: the decoded RLP string that could not be deserialized
#     """
# 
#     def __init__(self, message, serial):
#         super(DeserializationError, self).__init__(message)
#         self.serial = serial


# Path: tests/test_benchmark.py
from itertools import repeat, chain
from rlp.sedes import binary, CountableList
from rlp.exceptions import DecodingError, DeserializationError
import sys
import pytest
import rlp
    import pytest_benchmark  # noqa: F401



try:
except ImportError:
    do_benchmark = False
else:
    do_benchmark = True


# speed up setup in case tests aren't run anyway
if do_benchmark:
    SIZE = int(1e6)

else: