code: def _clean_url(url):
      ''' Produce a canonical Bokeh server URL.
  
      Args:
          url (str)
              A URL to clean, or "defatul". If "default" then the
              ``BOKEH_SERVER_HTTP_URL`` will be returned.
  
      Returns:
          str
  
      '''
      if url == 'default':
          url = DEFAULT_SERVER_HTTP_URL
  
      if url.startswith("ws"):
          raise ValueError("url should be the http or https URL for the server, not the websocket URL")
  
      return url.rstrip("/"f _clean_url(url):
      ''' Produce a canonical Bokeh server URL.
  
      Args:
          url (str)
              A URL to clean, or "defatul". If "default" then the
              ``BOKEH_SERVER_HTTP_URL`` will be returned.
  
      Returns:
          str
  
      '''
      if url == 'default':
          url = DEFAULT_SERVER_HTTP_URL
  
      if url.startswith("ws"):
          raise ValueError("url should be the http or https URL for the server, not the websocket URL")
  
      return url.rstrip("/")
docs: Produce a canonical Bokeh server URL.
  
      Args:
          url (str)
              A URL to clean, or "defatul". If "default" then the
              ``BOKEH_SERVER_HTTP_URL`` will be returned.
  
      Returns:
          str