'get_network_status(relay = None, default = UNDEFINED)
Provides the router status entry for the relay with the given fingerprint
or nickname. If the relay identifier could be either a fingerprint *or*
nickname then it\'s queried as a fingerprint.
This provides
:class:`~stem.descriptor.router_status_entry.RouterStatusEntryMicroV3`
instances if tor is using microdescriptors...
controller.get_conf(\'UseMicrodescriptors\', \'0\') == \'1\'
... and :class:`~stem.descriptor.router_status_entry.RouterStatusEntryV3`
otherwise.
If no **relay** is provided then this defaults to ourselves. Remember that
this requires that we\'ve retrieved our own descriptor from remote
authorities so this both won\'t be available for newly started relays and
may be up to around an hour out of date.
.. versionchanged:: 1.3.0
Changed so we\'d fetch our own descriptor if no \'relay\' is provided.
:param str relay: fingerprint or nickname of the relay to be queried
:param object default: response if the query fails
:returns: :class:`~stem.descriptor.router_status_entry.RouterStatusEntry`
for the given relay
:raises:
* :class:`stem.DescriptorUnavailable` if unable to provide a descriptor
for the given relay
* :class:`stem.ControllerError` if unable to query the descriptor
* **ValueError** if **relay** doesn\'t conform with the pattern for being
a fingerprint or nickname
An exception is only raised if we weren\'t provided a default response.'

@with_default()
def get_network_status(self, relay=None, default=UNDEFINED):

    if (relay is None):
        try:
            relay = self.get_info('fingerprint')
        except stem.ControllerError as exc:
            raise stem.ControllerError(('Unable    to    determine    our    own    fingerprint:    %s' % exc))
    if stem.util.tor_tools.is_valid_fingerprint(relay):
        query = ('ns/id/%s' % relay)
    elif stem.util.tor_tools.is_valid_nickname(relay):
        query = ('ns/name/%s' % relay)
    else:
        raise ValueError(("'%s'    isn't    a    valid    fingerprint    or    nickname" % relay))
    try:
        desc_content = self.get_info(query, get_bytes=True)
    except stem.InvalidArguments as exc:
        if str(exc).startswith('GETINFO    request    contained    unrecognized    keywords:'):
            raise stem.DescriptorUnavailable(("Tor    was    unable    to    provide    the    descriptor    for    '%s'" % relay))
        else:
            raise exc
    if (not desc_content):
        raise stem.DescriptorUnavailable('Descriptor    information    is    unavailable,    tor    might    still    be    downloading    it')
    if (self.get_conf('UseMicrodescriptors', '0') == '1'):
        return stem.descriptor.router_status_entry.RouterStatusEntryMicroV3(desc_content)
    else:
        return stem.descriptor.router_status_entry.RouterStatusEntryV3(desc_content)
