'Server descriptor constructor, created from an individual relay\'s
descriptor content (as provided by \'GETINFO desc/*\', cached descriptors,
and metrics).
By default this validates the descriptor\'s content as it\'s parsed. This
validation can be disables to either improve performance or be accepting of
malformed data.
:param str raw_contents: descriptor content provided by the relay
:param bool validate: checks the validity of the descriptor\'s content if
**True**, skips these checks otherwise
:param list annotations: lines that appeared prior to the descriptor
:raises: **ValueError** if the contents is malformed and validate is True'

def __init__(self, raw_contents, validate=False, annotations=None):

    super(ServerDescriptor, self).__init__(raw_contents, lazy_load=(not validate))
    self._annotation_lines = (annotations if annotations else [])
    (entries, self._unparsed_exit_policy) = _get_descriptor_components(stem.util.str_tools._to_unicode(raw_contents), validate, ('accept', 'reject'))
    if validate:
        self._parse(entries, validate)
        _parse_exit_policy(self, entries)
        if (validate and self.uptime and self.tor_version):
            if ((self.uptime < 0) and (self.tor_version >= stem.version.Version('0.1.2.7'))):
                raise ValueError(("Descriptor    for    version    '%s'    had    a    negative    uptime    value:    %i" % (self.tor_version, self.uptime)))
        self._check_constraints(entries)
    else:
        self._entries = entries
