def pull_tagged(data5: bytearray) -> Tuple[str, Sequence[int]]:
    """Try to pull out tagged data: returns tag, tagged data. Mutates data in-place."""
    if len(data5) < 3:
        raise ValueError("Truncated field")
    length = data5[1] * 32 + data5[2]
    if length > len(data5) - 3:
        raise ValueError(
            "Truncated {} field: expected {} values".format(CHARSET[data5[0]], length))
    ret = (CHARSET[data5[0]], data5[3:3+length])
    del data5[:3 + length]    # much faster than: data5=data5[offset:]
    return ret
Try to pull out tagged data: returns tag, tagged data. Mutates data in-place.
electrum/lnaddr.py