# 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
          if abs(val - res) < 0.00001:
            res = val

        if getattr(self, self.result[i], None) != res:
          # we need to do a case-insensitive comparison on values...
          # XXX datatype == string also covers keys! we need to fix this...
          if self.result[i] == 'value' and datatype == 'string' and res.lower(
          ) == self.value.lower():
            # we are equal on a case insensitive basis...
            LOG.warning('case.insensitive.prepare',
                        [self.value, res] + result[0:n - 1])
            # we believe we're OK with this...
            # change the value we have to match what is really there...
            self.value = res
          else:
            raise MQLInternalError(
                self.query,
                "Values didn't match in prepare",
                key=self.result[i],
                value=getattr(self, self.result[i], None),
                newvalue=res)
      else:
        # we asked, so we set the value
        setattr(self, self.result[i], res)

    # now the direct child if any (fill in the '@' slots. Nodes never have a direct child.)
    if self.child:
      child = getattr(self, self.child)
      if child.state not in ('ensure', 'ensurechild', 'match', 'delete',
                             'default'):

# 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

          if abs(val - res) < 0.00001:
            res = val

        if getattr(self, self.result[i], None) != res:
          # we need to do a case-insensitive comparison on values...
          # XXX datatype == string also covers keys! we need to fix this...
          if self.result[i] == 'value' and datatype == 'string' and res.lower(
          ) == self.value.lower():
            # we are equal on a case insensitive basis...
            LOG.warning('case.insensitive.prepare',
                        [self.value, res] + result[0:n - 1])
            # we believe we're OK with this...
            # change the value we have to match what is really there...
            self.value = res
          else:
            raise MQLInternalError(
                self.query,
                "Values didn't match in prepare",
                key=self.result[i],
                value=getattr(self, self.result[i], None),
                newvalue=res)
      else:
        # we asked, so we set the value
        setattr(self, self.result[i], res)

    # now the direct child if any (fill in the '@' slots. Nodes never have a direct child.)
    if self.child:
      child = getattr(self, self.child)
      if child.state not in ('ensure', 'ensurechild', 'match', 'delete',
                             'default'):

        raise MQLInternalError(