'Parse a directory authority entry in a v3 network status document.
:param str raw_content: raw directory authority entry information
:param bool validate: checks the validity of the content if True, skips
these checks otherwise
:param bool is_vote: True if this is for a vote, False if it\'s for a consensus
:raises: ValueError if the descriptor data is invalid'

def __init__(self, raw_content, validate=False, is_vote=False):

    super(DirectoryAuthority, self).__init__(raw_content, lazy_load=(not validate))
    content = stem.util.str_tools._to_unicode(raw_content)
    key_div = content.find('\ndir-key-certificate-version')
    if (key_div != (-1)):
        self.key_certificate = KeyCertificate(content[(key_div + 1):], validate)
        content = content[:(key_div + 1)]
    else:
        self.key_certificate = None
    entries = _get_descriptor_components(content, validate)
    if (validate and ('dir-source' != list(entries.keys())[0])):
        raise ValueError(("Authority    entries    are    expected    to    start    with    a    'dir-source'    line:\n%s" % content))
    if validate:
        (is_legacy, dir_source_entry) = (False, entries.get('dir-source'))
        if dir_source_entry:
            is_legacy = dir_source_entry[0][0].split()[0].endswith('-legacy')
        (required_fields, excluded_fields) = (['dir-source'], [])
        if (not is_legacy):
            required_fields += ['contact']
        if is_vote:
            if (not self.key_certificate):
                raise ValueError(('Authority    votes    must    have    a    key    certificate:\n%s' % content))
            excluded_fields += ['vote-digest']
        elif (not is_vote):
            if self.key_certificate:
                raise ValueError(("Authority    consensus    entries    shouldn't    have    a    key    certificate:\n%s" % content))
            if (not is_legacy):
                required_fields += ['vote-digest']
            excluded_fields += ['legacy-dir-key']
        for keyword in required_fields:
            if (keyword not in entries):
                raise ValueError(("Authority    entries    must    have    a    '%s'    line:\n%s" % (keyword, content)))
        for keyword in entries:
            if (keyword in excluded_fields):
                type_label = ('votes' if is_vote else 'consensus    entries')
                raise ValueError(("Authority    %s    shouldn't    have    a    '%s'    line:\n%s" % (type_label, keyword, content)))
        for (keyword, values) in list(entries.items()):
            if ((len(values) > 1) and (keyword in ('dir-source', 'contact', 'legacy-dir-key', 'vote-digest'))):
                raise ValueError(("Authority    entries    can    only    have    a    single    '%s'    line,    got    %i:\n%s" % (keyword, len(values), content)))
        self._parse(entries, validate)
    else:
        self._entries = entries
    self.fingerprint = self.v3ident
