code: def is_authorized(self, request):
          
          if self._is_request_in_include_path(request):
              if self._is_request_in_exclude_path(request):
                  return True
              else:
                  auth = request.authorization
                  if auth and auth[0] == 'Basic':
                      credentials = b64decode(auth[1]).decode('UTF-8')
                      username, password = credentials.split(':', 1)
                      return self._users.get(username) == password
                  else:
                      return False
          else:
              return True
docs: 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.