(codec)
Return a human readable display name for a codec if available

    Parameters
    ----------
    codec : str
        A codec name (as accepted by `codecs.lookup`).

    Returns
    -------
    name : str
Return a human readable display name for a codec if available
Return a human readable display name for a codec if available
def display_name(codec):
    # type: (str) -> str
    """
    Return a human readable display name for a codec if available

    Parameters
    ----------
    codec : str
        A codec name (as accepted by `codecs.lookup`).

    Returns
    -------
    name : str
    """
    global __display_name
    if __display_name is None:
        d = {}
        for k, name in ENCODING_DISPLAY_NAME:
            try:
                co = codecs.lookup(k)
            except LookupError:
                pass
            else:
                d[co.name] = name
        __display_name = d
    try:
        co = codecs.lookup(codec)
    except LookupError:
        return codec
    else:
        return __display_name.get(co.name, codec)
def display_name ( codec ) : # type: (str) -> str global __display_name if __display_name is None : d = { } for k , name in ENCODING_DISPLAY_NAME : try : co = codecs . lookup ( k ) except LookupError : pass else : d [ co . name ] = name __display_name = d try : co = codecs . lookup ( codec ) except LookupError : return codec else : return __display_name . get ( co . name , codec )