code: def sanitize_url(url):
      
      parts = urlparse(url)
      if parts.password is None:
          return url
      host_info = parts.netloc.rsplit('@', 1)[-1]
      parts = parts._replace(netloc='{}:{}@{}'.format(
          parts.username, REDACTED, host_info))
      return parts.geturl()
docs: Redact password in urls.