# Path: error.py
# def is_valid_HTTP_code(code):
# def get_HTTP_err(code):
#   def __init__(self,
#                msg,
#                http_code=400,
#                app_code=DEF_ME_CODE,
#                inner_exc=None,
#                **kwds):
#   def gen_msgs(self, **kwds):
#   def get_err_dict(self):
#   def __str__(self):
#   def __init__(self,
#                msg,
#                http_code=500,
#                app_code=ParameterizedError.DEF_ME_CODE,
#                inner_exc=None,
#                **kwds):
#   def __init__(self, msg=None, *args, **kwds):
# class ParameterizedError(Exception):
# class NetworkAddressError(ParameterizedError):
# class ContentLoadError(ParameterizedError):
# class TypeVerifyError(ParameterizedError):
# class EmailError(ParameterizedError):
# class SubscriptionError(ParameterizedError):
# class MSSError(ParameterizedError):
# class UserLookupError(ParameterizedError):
# class UserAuthError(ParameterizedError):
# class BlobError(ParameterizedError):
# class BLOBClientError(ParameterizedError):
# class RelevanceError(ParameterizedError):
# class TextSearchError(ParameterizedError):
# class AutocompleteError(ParameterizedError):
# class EmptyResult(ParameterizedError):
# class GraphConnectionError(ParameterizedError):
# class FormattingError(ParameterizedError):
# class SessionError(ParameterizedError):
# class ConfigError(ParameterizedError):
# class SanitizationError(ParameterizedError):
# class BlurbError(ParameterizedError):
# class DomainOperationError(ParameterizedError):
# class GenericRuntimeError(ParameterizedError):
# class OAuthDisabledError(ParameterizedError):
# class RecaptchaError(ParameterizedError):
# class ReadOnlyDatabaseError(ParameterizedError):
#   DEF_PFX = '/api/status/error'
#   DEF_ME_CODE = '/unknown/unknown'


from grquoting import quote, unquote
from itertools import chain
from utils import (valid_value_op, valid_timestamp_op, valid_timestamp,
                   valid_history_op, valid_guid, ReadMode, WriteMode,
                   PrepareMode, CheckMode, Missing, ResultDict, incr_subseq)
from error import (MQLResultError, MQLInternalError, MQLInternalParseError,
                   MQLValueAlreadyInUseError, MQLTooManyValuesForUniqueQuery)
from pymql.log import LOG

            self.orig.previous = self.guid
          elif self.result[i] == 'value' and datatype == 'string' and res.lower(
          ) == newvalue.lower():
            # we are equal on a case insensitive basis...
            LOG.warning('case.insensitive.unique',
                        [self.value, res] + result[0:n - 1])
            # we believe we're OK with this...
            pass
          elif self.state == 'unique_check':
            # if this is a delete, finding a different value is not an error. You might
            # ask why we bother to do the unique check in the first place; mostly because
            # it is hard to detect a delete at the time the check is inserted.

            # we depend on the deletion already having been processed
            if self.orig.state == 'notpresent':
              pass
            else:
              # bug 6712; we want to provide a good error message here...
              # updates always occur on the child or the value.
              if self.unique in ('key', 'value', self.child):
                raise MQLValueAlreadyInUseError(
                    self.query,
                    key=self.result[i],
                    existing_value=res,
                    new_value=newvalue,
                    update=True)

              # if we don't think an update will help, just tell
              # the user to try a delete.

# Path: error.py
# def is_valid_HTTP_code(code):
# def get_HTTP_err(code):
#   def __init__(self,
#                msg,
#                http_code=400,
#                app_code=DEF_ME_CODE,
#                inner_exc=None,
#                **kwds):
#   def gen_msgs(self, **kwds):
#   def get_err_dict(self):
#   def __str__(self):
#   def __init__(self,
#                msg,
#                http_code=500,
#                app_code=ParameterizedError.DEF_ME_CODE,
#                inner_exc=None,
#                **kwds):
#   def __init__(self, msg=None, *args, **kwds):
# class ParameterizedError(Exception):
# class NetworkAddressError(ParameterizedError):
# class ContentLoadError(ParameterizedError):
# class TypeVerifyError(ParameterizedError):
# class EmailError(ParameterizedError):
# class SubscriptionError(ParameterizedError):
# class MSSError(ParameterizedError):
# class UserLookupError(ParameterizedError):
# class UserAuthError(ParameterizedError):
# class BlobError(ParameterizedError):
# class BLOBClientError(ParameterizedError):
# class RelevanceError(ParameterizedError):
# class TextSearchError(ParameterizedError):
# class AutocompleteError(ParameterizedError):
# class EmptyResult(ParameterizedError):
# class GraphConnectionError(ParameterizedError):
# class FormattingError(ParameterizedError):
# class SessionError(ParameterizedError):
# class ConfigError(ParameterizedError):
# class SanitizationError(ParameterizedError):
# class BlurbError(ParameterizedError):
# class DomainOperationError(ParameterizedError):
# class GenericRuntimeError(ParameterizedError):
# class OAuthDisabledError(ParameterizedError):
# class RecaptchaError(ParameterizedError):
# class ReadOnlyDatabaseError(ParameterizedError):
#   DEF_PFX = '/api/status/error'
#   DEF_ME_CODE = '/unknown/unknown'


# Path: mql/qprim.py
from grquoting import quote, unquote
from itertools import chain
from utils import (valid_value_op, valid_timestamp_op, valid_timestamp,
                   valid_history_op, valid_guid, ReadMode, WriteMode,
                   PrepareMode, CheckMode, Missing, ResultDict, incr_subseq)
from error import (MQLResultError, MQLInternalError, MQLInternalParseError,
                   MQLValueAlreadyInUseError, MQLTooManyValuesForUniqueQuery)
from pymql.log import LOG


            self.orig.previous = self.guid
          elif self.result[i] == 'value' and datatype == 'string' and res.lower(
          ) == newvalue.lower():
            # we are equal on a case insensitive basis...
            LOG.warning('case.insensitive.unique',
                        [self.value, res] + result[0:n - 1])
            # we believe we're OK with this...
            pass
          elif self.state == 'unique_check':
            # if this is a delete, finding a different value is not an error. You might
            # ask why we bother to do the unique check in the first place; mostly because
            # it is hard to detect a delete at the time the check is inserted.

            # we depend on the deletion already having been processed
            if self.orig.state == 'notpresent':
              pass
            else:
              # bug 6712; we want to provide a good error message here...
              # updates always occur on the child or the value.
              if self.unique in ('key', 'value', self.child):
                raise MQLValueAlreadyInUseError(
                    self.query,
                    key=self.result[i],
                    existing_value=res,
                    new_value=newvalue,
                    update=True)

              # if we don't think an update will help, just tell
              # the user to try a delete.

              raise MQLValueAlreadyInUseError(