def certify_iterable_schema(value, schema=None, required=True):
    """
    Certify an iterable against a schema.

    :param iterable value:
        The iterable to certify against the schema.
    :param iterable schema:
        The schema to use
    :param bool required:
        Whether the value can't be `None`. Defaults to True.
    :return:
        The validated iterable.
    :rtype:
        iterable
    """
    if schema is not None:
        if len(schema) != len(value):
            raise CertifierValueError(
                "encountered {extra} extra items".format(
                    extra=len(value) - len(schema)),
                value=value,
                required=required,
            )

        for index, certifier in enumerate(schema):
            try:
                certifier(value=value[index])
            except CertifierError as exc:
                six.raise_from(
                    CertifierValueError(
                        message="invalid value {value!r} for item {index}".format(
                            index=index, value=value[index]),
                        value=value,
                        required=required,
                    ),
                    exc,
                )
Certify an iterable against a schema.

    :param iterable value:
        The iterable to certify against the schema.
    :param iterable schema:
        The schema to use
    :param bool required:
        Whether the value can't be `None`. Defaults to True.
    :return:
        The validated iterable.
    :rtype:
        iterable