code: def set_basic_auth(self, username, password, realm):
      
      self._passmgr.add_password(realm, self._base_url, username, password)
      return self
docs: Set up basic auth for the client
      @param username: Login name.
      @param password: Login password.
      @param realm: The authentication realm.
      @return: The current object