# Path: fastavro/const.py
# INT_MAX_VALUE = (1 << 31) - 1
# 
# INT_MIN_VALUE = -(1 << 31)
# 
# LONG_MAX_VALUE = (1 << 63) - 1
# 
# LONG_MIN_VALUE = -(1 << 63)
# 
# Path: fastavro/_validate_common.py
# class ValidationError(Exception):
#     def __init__(self, *errors):
#         message = json.dumps([str(e) for e in errors], indent=2, ensure_ascii=False)
#         super(ValidationError, self).__init__(message)
#         self.errors = errors
# 
# class ValidationErrorData(
#     namedtuple("ValidationErrorData", ["datum", "schema", "field"])
# ):
#     def __str__(self):
#         # update field for prettier printing
#         field = self.field
#         if field is None:
#             field = ""
# 
#         if self.datum is None:
#             return f"Field({field}) is None expected {self.schema}"
# 
#         return (
#             f"{field} is <{self.datum}> of type "
#             + f"{type(self.datum)} expected {self.schema}"
#         )
# 
# Path: fastavro/schema.py
# FINGERPRINT_ALGORITHMS = _schema.FINGERPRINT_ALGORITHMS
# 
# Path: fastavro/logical_writers.py
# LOGICAL_WRITERS = _logical_writers.LOGICAL_WRITERS
# 
# Path: fastavro/_schema_common.py
# class UnknownType(ValueError):
#     def __init__(self, name):
#         super().__init__(name)
#         self.name = name


import array
import numbers
from collections.abc import Mapping, Sequence
from fastavro.const import INT_MAX_VALUE, INT_MIN_VALUE, LONG_MAX_VALUE, LONG_MIN_VALUE
from ._validate_common import ValidationError, ValidationErrorData
from .schema import extract_record_type, extract_logical_type, schema_name, parse_schema
from .logical_writers import LOGICAL_WRITERS
from ._schema_common import UnknownType
        validate(record, schema)
    """
    named_schemas = {}
    parsed_schema = parse_schema(schema, named_schemas)
    return _validate(datum, parsed_schema, named_schemas, field, raise_errors)


def validate_many(records, schema, raise_errors=True):
    """
    Validate a list of data!

    Parameters
    ----------
    records: iterable
        List of records to validate
    schema: dict
        Schema
    raise_errors: bool, optional
        If true, errors are raised for invalid data. If false, a simple
        True (valid) or False (invalid) result is returned


    Example::

        from fastavro.validation import validate_many
        schema = {...}
        records = [{...}, {...}, ...]
        validate_many(records, schema)
    """
    named_schemas = {}

# Path: fastavro/const.py
# INT_MAX_VALUE = (1 << 31) - 1
# 
# INT_MIN_VALUE = -(1 << 31)
# 
# LONG_MAX_VALUE = (1 << 63) - 1
# 
# LONG_MIN_VALUE = -(1 << 63)
# 
# Path: fastavro/_validate_common.py
# class ValidationError(Exception):
#     def __init__(self, *errors):
#         message = json.dumps([str(e) for e in errors], indent=2, ensure_ascii=False)
#         super(ValidationError, self).__init__(message)
#         self.errors = errors
# 
# class ValidationErrorData(
#     namedtuple("ValidationErrorData", ["datum", "schema", "field"])
# ):
#     def __str__(self):
#         # update field for prettier printing
#         field = self.field
#         if field is None:
#             field = ""
# 
#         if self.datum is None:
#             return f"Field({field}) is None expected {self.schema}"
# 
#         return (
#             f"{field} is <{self.datum}> of type "
#             + f"{type(self.datum)} expected {self.schema}"
#         )
# 
# Path: fastavro/schema.py
# FINGERPRINT_ALGORITHMS = _schema.FINGERPRINT_ALGORITHMS
# 
# Path: fastavro/logical_writers.py
# LOGICAL_WRITERS = _logical_writers.LOGICAL_WRITERS
# 
# Path: fastavro/_schema_common.py
# class UnknownType(ValueError):
#     def __init__(self, name):
#         super().__init__(name)
#         self.name = name


# Path: fastavro/_validation_py.py
import array
import numbers
from collections.abc import Mapping, Sequence
from fastavro.const import INT_MAX_VALUE, INT_MIN_VALUE, LONG_MAX_VALUE, LONG_MIN_VALUE
from ._validate_common import ValidationError, ValidationErrorData
from .schema import extract_record_type, extract_logical_type, schema_name, parse_schema
from .logical_writers import LOGICAL_WRITERS
from ._schema_common import UnknownType

        validate(record, schema)
    """
    named_schemas = {}
    parsed_schema = parse_schema(schema, named_schemas)
    return _validate(datum, parsed_schema, named_schemas, field, raise_errors)


def validate_many(records, schema, raise_errors=True):
    """
    Validate a list of data!

    Parameters
    ----------
    records: iterable
        List of records to validate
    schema: dict
        Schema
    raise_errors: bool, optional
        If true, errors are raised for invalid data. If false, a simple
        True (valid) or False (invalid) result is returned


    Example::

        from fastavro.validation import validate_many
        schema = {...}
        records = [{...}, {...}, ...]
        validate_many(records, schema)
    """
    named_schemas = {}

    parsed_schema = parse_schema(schema, named_schemas)