def METHOD_NAME(iri):
    """Decodes an internationalized domain name (IDN)."""
    parts = urlparse(iri)
    parts_seq = list(
        part.encode('idna')
        if parti == 1 else urlencode_non_ascii(part.encode('utf-8'))
        for parti, part in enumerate(parts)
    )
    parsed = urlunparse(parts_seq)
    return parsed.decode()