def METHOD_NAME(self, spec, method=None, level=0, authn_authority=""):
    if spec.authn_context_class_ref:
        _cls_ref = spec.authn_context_class_ref.text
        try:
            _refs = self.db["key"][_cls_ref]
        except KeyError:
            return
        else:
            _remain = []
            for _ref in _refs:
                item = self.db["info"][_ref]
                if method and method != item["method"]:
                    _remain.append(_ref)
                if level and level != item["level"]:
                    _remain.append(_ref)
                if authn_authority and authn_authority != item["authn_authority"]:
                    _remain.append(_ref)
            if _remain:
                self.db[_cls_ref] = _remain