code: def _clean_netloc(netloc):
      
      try:
          return netloc.rstrip('.:').lower()
      except:
          return netloc.rstrip('.:').decode('utf-8').lower().encode('utf-8')
docs: Remove trailing '.' and ':' and tolower.
  
      >>> _clean_netloc('eXample.coM:')
      'example.com'