code: def set_api_url(self, api_url="https://{lang}.wikipedia.org/w/api.php", lang="en"):
          
          old_api_url = self._api_url
          old_lang = self._lang
          self._lang = lang.lower()
          self._api_url = api_url.format(lang=self._lang)
          try:
              self._get_site_info()
              self.__supported_languages = None  # reset this
          except MediaWikiException:
              # reset api url and lang in the event that the exception was caught
              self._api_url = old_api_url
              self._lang = old_lang
              raise MediaWikiAPIURLError(api_url)
          self.clear_memoized()
docs: Set the API URL and language
  
              Args:
                  api_url (str): API URL to use
                  lang (str): Language of the API URL
              Raises:
                  :py:func:`mediawiki.exceptions.MediaWikiAPIURLError`: if the \
                  url is not a valid MediaWiki site