def is_authorized(self, request):
if self._is_request_in_include_path(request):<EOL><INDENT>if self._is_request_in_exclude_path(request):<EOL><INDENT>return True<EOL><DEDENT>else:<EOL><INDENT>auth = request.authorization<EOL>if auth and auth[<NUM_LIT:0>] == '<STR_LIT>':<EOL><INDENT>credentials = b64decode(auth[<NUM_LIT:1>]).decode('<STR_LIT>')<EOL>username, password = credentials.split('<STR_LIT::>', <NUM_LIT:1>)<EOL>return self._users.get(username) == password<EOL><DEDENT>else:<EOL><INDENT>return False<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>return True<EOL><DEDENT>
Check if the user is authenticated for the given request.

        The include_paths and exclude_paths are first checked. If
        authentication is required then the Authorization HTTP header is
        checked against the credentials.