parameters: (cls, uri)
return_statement: return defrag_uri
docstring: Normalize the URL to create a safe key for the cache
docstring_summary: Normalize the URL to create a safe key for the cache
docstring_tokens: Normalize the URL to create a safe key for the cache
function: def _urlnorm(cls, uri):
  
          """Normalize the URL to create a safe key for the cache"""
  
          (scheme, authority, path, query, fragment) = parse_uri(uri)
  
          if not scheme or not authority:
  
              raise Exception("Only absolute URIs are allowed. uri = %s" % uri)
  
  
  
          scheme = scheme.lower()
  
          authority = authority.lower()
  
  
  
          if not path:
  
              path = "/"
  
  
  
          # Could do syntax based normalization of the URI before
  
          # computing the digest. See Section 6.2.2 of Std 66.
  
          request_uri = query and "?".join([path, query]) or path
  
          defrag_uri = scheme + "://" + authority + request_uri
  
  
  
          return defrag_uri
function_tokens: def _urlnorm ( cls , uri ) : ( scheme , authority , path , query , fragment ) = parse_uri ( uri ) if not scheme or not authority : raise Exception ( "Only absolute URIs are allowed. uri = %s" % uri ) scheme = scheme . lower ( ) authority = authority . lower ( ) if not path : path = "/" # Could do syntax based normalization of the URI before # computing the digest. See Section 6.2.2 of Std 66. request_uri = query and "?" . join ( [ path , query ] ) or path defrag_uri = scheme + "://" + authority + request_uri return defrag_uri