def check_tag_data(data):
    "Raise a ValueError if DATA doesn't seem to be a well-formed ID3 tag."
    if len(data) < 10:
        raise ValueError("Tag too short")
    if data[0:3] != b"ID3":
        raise ValueError("Missing ID3 identifier")
    if data[3] >= 5 or data[4] != 0:
        raise ValueError("Unknown ID3 version")
    length = stagger.conversion.Syncsafe.decode(data[6:10]) + 10
    if len(data) != length:
        raise ValueError("Tag size mismatch")
def check_tag_data ( data ) : if len ( data ) < 10 : raise ValueError ( "Tag too short" ) if data [ 0 : 3 ] != b"ID3" : raise ValueError ( "Missing ID3 identifier" ) if data [ 3 ] >= 5 or data [ 4 ] != 0 : raise ValueError ( "Unknown ID3 version" ) length = stagger . conversion . Syncsafe . decode ( data [ 6 : 10 ] ) + 10 if len ( data ) != length : raise ValueError ( "Tag size mismatch" )
Raise a ValueError if DATA doesn't seem to be a well-formed ID3 tag.