human
I wrote the below code

    def wrapper(handler_class):
        def wrap_execute(handler_execute):
            def check_auth(handler, kwargs):
                auth = handler.request.headers.get('Authorization')
                if ((auth is None) or (not auth.startswith('Basic    '))):
                    handler.set_status(401)
                    handler.set_header('WWW-Authenticate', 'Basic    realm=Restricted')
                else:
                    (username, password) = base64.b64decode(auth[6:]).split(':', 1)
                    if login_cb(username, password):
                        return
                    else:
                        handler.set_status(403)
                handler._transforms = []
                handler.finish()
            def _execute(self, transforms, *args, **kwargs):
                check_auth(self, kwargs)
                return handler_execute(self, transforms, *args, **kwargs)
            return _execute
        handler_class._execute = wrap_execute(handler_class._execute)
        return handler_class
    return wrapper

What's a good function header?
assistant
#Here's a good function header.

def http_basic_auth(login_cb=(lambda username, password: False)):