# Path: boto3/exceptions.py
# class DynamoDBNeedsConditionError(Boto3Error):
#     """Raised when input is not a condition"""
# 
#     def __init__(self, value):
#         msg = (
#             f'Expecting a ConditionBase object. Got {value} of type {type(value)}. '
#             f'Use AttributeBase object methods (i.e. Attr().eq()). to '
#             f'generate ConditionBase instances.'
#         )
#         Exception.__init__(self, msg)
# 
# class DynamoDBNeedsKeyConditionError(Boto3Error):
#     pass
# 
# class DynamoDBOperationNotSupportedError(Boto3Error):
#     """Raised for operations that are not supported for an operand."""
# 
#     def __init__(self, operation, value):
#         msg = (
#             f'{operation} operation cannot be applied to value {value} of type '
#             f'{type(value)} directly. Must use AttributeBase object methods '
#             f'(i.e. Attr().eq()). to generate ConditionBase instances first.'
#         )
#         Exception.__init__(self, msg)


import re
from collections import namedtuple
from boto3.exceptions import (
    DynamoDBNeedsConditionError,
    DynamoDBNeedsKeyConditionError,
    DynamoDBOperationNotSupportedError,
)
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# https://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanying this file. This file is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.


ATTR_NAME_REGEX = re.compile(r'[^.\[\]]+(?![^\[]*\])')


class ConditionBase:

    expression_format = ''
    expression_operator = ''
    has_grouped_values = False

    def __init__(self, *values):
        self._values = values

    def __and__(self, other):
        if not isinstance(other, ConditionBase):
            raise DynamoDBOperationNotSupportedError('AND', other)
        return And(self, other)

    def __or__(self, other):
        if not isinstance(other, ConditionBase):

# Path: boto3/exceptions.py
# class DynamoDBNeedsConditionError(Boto3Error):
#     """Raised when input is not a condition"""
# 
#     def __init__(self, value):
#         msg = (
#             f'Expecting a ConditionBase object. Got {value} of type {type(value)}. '
#             f'Use AttributeBase object methods (i.e. Attr().eq()). to '
#             f'generate ConditionBase instances.'
#         )
#         Exception.__init__(self, msg)
# 
# class DynamoDBNeedsKeyConditionError(Boto3Error):
#     pass
# 
# class DynamoDBOperationNotSupportedError(Boto3Error):
#     """Raised for operations that are not supported for an operand."""
# 
#     def __init__(self, operation, value):
#         msg = (
#             f'{operation} operation cannot be applied to value {value} of type '
#             f'{type(value)} directly. Must use AttributeBase object methods '
#             f'(i.e. Attr().eq()). to generate ConditionBase instances first.'
#         )
#         Exception.__init__(self, msg)


# Path: boto3/dynamodb/conditions.py
import re
from collections import namedtuple
from boto3.exceptions import (
    DynamoDBNeedsConditionError,
    DynamoDBNeedsKeyConditionError,
    DynamoDBOperationNotSupportedError,
)

# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# https://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanying this file. This file is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.


ATTR_NAME_REGEX = re.compile(r'[^.\[\]]+(?![^\[]*\])')


class ConditionBase:

    expression_format = ''
    expression_operator = ''
    has_grouped_values = False

    def __init__(self, *values):
        self._values = values

    def __and__(self, other):
        if not isinstance(other, ConditionBase):
            raise DynamoDBOperationNotSupportedError('AND', other)
        return And(self, other)

    def __or__(self, other):
        if not isinstance(other, ConditionBase):

            raise DynamoDBOperationNotSupportedError('OR', other)