# 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 utils import valid_idname, valid_guid, valid_key, reserved_word, find_key_in_query
from error import MQLParseError, MQLInternalError, MQLTypeError
from env import Guid
from pymql.util import keyquote
from pymql.log import LOG
from pymql.util.mwdatetime import coerce_datetime, uncoerce_datetime
import copy
        thisprop.set_delegation(prop['is_delegated_to']['@guid'])
        # replace prop by the delegatee...
        prop = prop['is_delegated_to']

      if prop.get('is_unique_property'
                 ) and prop['is_unique_property'][':value'] == True:
        # we refuse to allow reverse properties to be unique -- we just can't enforce it...
        thisprop.unique = True
      elif propname == self.get_default_property_name() or self.category in (
          'value', 'link'):
        # the default name is always unique. This should be a warning at least...
        raise MQLTypeError(
            None,
            'Saw a non-unique name %(property)s in type %(expected_type)s that must be unique',
            property=propname,
            expected_type=self.id)

      if prop.get('is_enumeration_of'):
        if prop.get('has_master_property'):
          raise MQLTypeError(
              None,
              'Properties cannot be reverse properties and enumerations',
              property=propname)
        if prop.get('-has_master_property'):
          raise MQLTypeError(
              None,
              'Enumerated properties cannot have reverse properties',
              property=propname)

        if thisprop.ect_guid != self.factory.enumeration_ect_guid:

# 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/schema.py
from utils import valid_idname, valid_guid, valid_key, reserved_word, find_key_in_query
from error import MQLParseError, MQLInternalError, MQLTypeError
from env import Guid
from pymql.util import keyquote
from pymql.log import LOG
from pymql.util.mwdatetime import coerce_datetime, uncoerce_datetime
import copy

        thisprop.set_delegation(prop['is_delegated_to']['@guid'])
        # replace prop by the delegatee...
        prop = prop['is_delegated_to']

      if prop.get('is_unique_property'
                 ) and prop['is_unique_property'][':value'] == True:
        # we refuse to allow reverse properties to be unique -- we just can't enforce it...
        thisprop.unique = True
      elif propname == self.get_default_property_name() or self.category in (
          'value', 'link'):
        # the default name is always unique. This should be a warning at least...
        raise MQLTypeError(
            None,
            'Saw a non-unique name %(property)s in type %(expected_type)s that must be unique',
            property=propname,
            expected_type=self.id)

      if prop.get('is_enumeration_of'):
        if prop.get('has_master_property'):
          raise MQLTypeError(
              None,
              'Properties cannot be reverse properties and enumerations',
              property=propname)
        if prop.get('-has_master_property'):
          raise MQLTypeError(
              None,
              'Enumerated properties cannot have reverse properties',
              property=propname)

        if thisprop.ect_guid != self.factory.enumeration_ect_guid:

          raise MQLTypeError(