def _protocol_determine(raw):
    """
    Determine which protocol was used when saving the file.

    :param list raw: returned by _load_raw
    :return: protocol used when file was saved
    :rtype: int
    """
    if not len(raw):
        raise ValueError("Can't determine protocol of empty file.")

    if 'protocol' not in raw[0]:
        return 1

    return raw[0]['protocol']