# 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 error import MQLInternalError, MQLResultError, MQLTooManyValuesForUniqueQuery
from utils import Missing, find_key_in_query
from grquoting import quote
from env import DeferredIdLookup, DeferredMidOfGuidLookup, DeferredMidsOfGuidLookup, quote_value, unquote_value, Guid
from pymql.log import LOG
from collections import defaultdict
import mid
          rpn = expected_rpn
        elif data_rpn and self.query.terminal == 'D':
          rpn = data_rpn

        if rpn:
          if self.final.query.list:
            rpn_res = [rpn_res]
          high_result[rpn] = rpn_res

      if self.implied:
        # a non terminal with a 'link' clause
        self.parse_result_implied_value(sub_result, link, varenv)

      n = len(self.result)
      for i, qp in enumerate(self.contents):
        if qp.category == 'node':
          # we must have specified RPN to do this...
          rpn = stype.get_right_property_name(self.query)
          high_result[rpn] = qp.parse_result_right(sub_result[n + i], varenv)
        elif qp.category == 'index':
          high_result['index'] = None
          index = qp.parse_result_index(sub_result[n + i], varenv)
          if index is not None:
            indexes.append((index, high_result))
        elif qp.category == 'attached':
          link[qp.query.key] = qp.parse_result_right(sub_result[n + i], varenv)
        elif qp.category == 'constraint':
          # the RPN may be only a constraint.
          pass
        else:

# 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/readqp.py
from error import MQLInternalError, MQLResultError, MQLTooManyValuesForUniqueQuery
from utils import Missing, find_key_in_query
from grquoting import quote
from env import DeferredIdLookup, DeferredMidOfGuidLookup, DeferredMidsOfGuidLookup, quote_value, unquote_value, Guid
from pymql.log import LOG
from collections import defaultdict
import mid

          rpn = expected_rpn
        elif data_rpn and self.query.terminal == 'D':
          rpn = data_rpn

        if rpn:
          if self.final.query.list:
            rpn_res = [rpn_res]
          high_result[rpn] = rpn_res

      if self.implied:
        # a non terminal with a 'link' clause
        self.parse_result_implied_value(sub_result, link, varenv)

      n = len(self.result)
      for i, qp in enumerate(self.contents):
        if qp.category == 'node':
          # we must have specified RPN to do this...
          rpn = stype.get_right_property_name(self.query)
          high_result[rpn] = qp.parse_result_right(sub_result[n + i], varenv)
        elif qp.category == 'index':
          high_result['index'] = None
          index = qp.parse_result_index(sub_result[n + i], varenv)
          if index is not None:
            indexes.append((index, high_result))
        elif qp.category == 'attached':
          link[qp.query.key] = qp.parse_result_right(sub_result[n + i], varenv)
        elif qp.category == 'constraint':
          # the RPN may be only a constraint.
          pass
        else:

          raise MQLInternalError(