def normalizeURL(url):
 try:
  normalized = urinorm.urinorm(url)
 except ValueError as why:
  raise DiscoveryFailure(('Normalizing identifier: %s' % (why[0],)), None)
 else:
  return urlparse.urldefrag(normalized)[0]

def normalizeURL ( url ) : try : normalized = urinorm . urinorm ( url ) except ValueError as why : raise DiscoveryFailure ( ( 'Normalizing identifier: %s' % ( why [ 0 ] , ) ) , None ) else : return urlparse . urldefrag ( normalized ) [ 0 ]
normalize a url .