code: def shorten_duplicate_content_url(url):
      
      if '#' in url:
          url = url.split('#', 1)[0]
      if url.endswith('index.html'):
          return url[:-10]
      if url.endswith('index.htm'):
          return url[:-9]
      return url
docs: Remove anchor part and trailing index.html from URL.