# Path: src/formencode/api.py
# def get_localedir():
# def set_stdtranslation(domain="FormEncode", languages=None,
#                        localedir=get_localedir()):
# def deprecation_warning(old, new=None, stacklevel=3):
# def deprecated(old=None, new=None):
#     def outer(func):
#         def inner(*args, **kwargs):
# def is_empty(value):
# def is_validator(obj):
#     def __init__(self, msg,
#                  value, state, error_list=None, error_dict=None):
#     def __str__(self):
#         def __unicode__(self):
#     def unpack_errors(self, encode_variables=False, dict_char='.',
#                       list_char='-'):
#     def __classinit__(cls, new_attrs):
#     def __init__(self, *args, **kw):
#     def to_python(self, value, state=None):
#     def from_python(self, value, state=None):
#         def _message_vars_decode(self, message_vars):
#     def message(self, msgName, state, **kw):
#     def all_messages(self):
#     def subvalidators(self):
#     def _initialize_docstring(cls):
#     def __repr__(self):
#     def __classinit__(cls, new_attrs):
#     def to_python(self, value, state=None):
#     def from_python(self, value, state=None):
#     def is_empty(self, value):
#     def empty_value(self, value):
#     def assert_string(self, value, state):
#     def base64encode(self, value):
#     def _validate_noop(self, value, state=None):
# class NoDefault(object):
# class Invalid(Exception):
# class Validator(declarative.Declarative):
# class _Identity(Validator):
# class FancyValidator(Validator):


from .api import (FancyValidator, Identity, Invalid, NoDefault, Validator,
    is_validator)
import six

    The validators are evaluated left to right when validating to Python.

    The validators are evaluated right to left when validating from Python.

    Examples::

        >>> from formencode.validators import DictConverter
        >>> pv = Pipe(validators=[DictConverter({1: 2}),
        ... DictConverter({2: 3}), DictConverter({3: 4})])
        >>> pv.to_python(1)
        4
        >>> pv.from_python(4)
        1

    """

    def __repr__(self):
        return '<Pipe %s>' % self.validators

    def _attempt_convert(self, value, state, validate):
        # To preserve the order of the transformations, we do them
        # differently when we are converting to and from Python.
        validators = self.validators
        if validate is from_python:
            validators = reversed(self.validators)
        try:
            for validator in validators:
                value = validate(validator, value, state)
        except Invalid:

# Path: src/formencode/api.py
# def get_localedir():
# def set_stdtranslation(domain="FormEncode", languages=None,
#                        localedir=get_localedir()):
# def deprecation_warning(old, new=None, stacklevel=3):
# def deprecated(old=None, new=None):
#     def outer(func):
#         def inner(*args, **kwargs):
# def is_empty(value):
# def is_validator(obj):
#     def __init__(self, msg,
#                  value, state, error_list=None, error_dict=None):
#     def __str__(self):
#         def __unicode__(self):
#     def unpack_errors(self, encode_variables=False, dict_char='.',
#                       list_char='-'):
#     def __classinit__(cls, new_attrs):
#     def __init__(self, *args, **kw):
#     def to_python(self, value, state=None):
#     def from_python(self, value, state=None):
#         def _message_vars_decode(self, message_vars):
#     def message(self, msgName, state, **kw):
#     def all_messages(self):
#     def subvalidators(self):
#     def _initialize_docstring(cls):
#     def __repr__(self):
#     def __classinit__(cls, new_attrs):
#     def to_python(self, value, state=None):
#     def from_python(self, value, state=None):
#     def is_empty(self, value):
#     def empty_value(self, value):
#     def assert_string(self, value, state):
#     def base64encode(self, value):
#     def _validate_noop(self, value, state=None):
# class NoDefault(object):
# class Invalid(Exception):
# class Validator(declarative.Declarative):
# class _Identity(Validator):
# class FancyValidator(Validator):


# Path: src/formencode/compound.py
from .api import (FancyValidator, Identity, Invalid, NoDefault, Validator,
    is_validator)
import six


    The validators are evaluated left to right when validating to Python.

    The validators are evaluated right to left when validating from Python.

    Examples::

        >>> from formencode.validators import DictConverter
        >>> pv = Pipe(validators=[DictConverter({1: 2}),
        ... DictConverter({2: 3}), DictConverter({3: 4})])
        >>> pv.to_python(1)
        4
        >>> pv.from_python(4)
        1

    """

    def __repr__(self):
        return '<Pipe %s>' % self.validators

    def _attempt_convert(self, value, state, validate):
        # To preserve the order of the transformations, we do them
        # differently when we are converting to and from Python.
        validators = self.validators
        if validate is from_python:
            validators = reversed(self.validators)
        try:
            for validator in validators:
                value = validate(validator, value, state)
        except Invalid:

            if self.if_invalid is NoDefault: