def METHOD_NAME(self, kw, **kwargs):
    arg = self.kwargs.get(kw)
    if not arg:
        if "default" in kwargs:
            return kwargs["default"]
        raise AttributeError(
            "Missing argument from URL pattern: {}".format(kw))
    return arg