def _normalizeHostname(domain):
 def convertLabel(label):
  if _isASCII(label):
   return label.lower()
  return encodings.idna.ToASCII(label)
 return '.'.join(map(convertLabel, domain.split('.')))

def _normalizeHostname ( domain ) : def convertLabel ( label ) : if _isASCII ( label ) : return label . lower ( ) return encodings . idna . ToASCII ( label ) return '.' . join ( map ( convertLabel , domain . split ( '.' ) ) )
normalizes the given domain .