def METHOD_NAME(line, encoding="utf-8"):
    """decodes bytes to string, if line is not bytes, line is returned
    It will first attempt to decode line with value of `encoding`. If that fails, it will try with encoding="ISO-8859-2". If that fails, it will return line.
    Why is it trying encoding="ISO-8859-2". Looks like E+ uses this encoding in some example files and which is then output in the HTML file
    # TODO this code looks fragile. Maybe use standard library HTML parse to deal with encoding?
    Parameters
    ----------
    line : str, bytes
    encoding : str
    Returns
    -------
    line : str
        decoded line
    """
    try:
        return line.decode(encoding)
    except (AttributeError, UnicodeDecodeError) as e:
        if e.__class__ == UnicodeDecodeError:
            # encoding could be ISO-8859-2 in e+ html
            return METHOD_NAME(line, encoding="ISO-8859-2")
        else:
            return line