original_docstring:  parse addresses and hostnames, yield only valid addresses and networks
              :param address: address or network
              :return: boolean
          
docstring: parse addresses and hostnames, yield only valid addresses and networks
docstring_tokens: parse addresses and hostnames yield only valid addresses and networks
code: def _parse_address(self, address):
          """ parse addresses and hostnames, yield only valid addresses and networks
              :param address: address or network
              :return: boolean
          """
          address = address.strip()
          if address.find('/') > -1:
              # provided address could be a network
              try:
                  ipaddress.ip_network(unicode(address), strict=False)
                  yield address
                  return
              except (ipaddress.AddressValueError, ValueError):
                  pass
          else:
              # check if address is an ipv4/6 address or range
              try:
                  tmp = unicode(address).split('-')
                  addr1 = ipaddress.ip_address(tmp[0])
                  if len(tmp) > 1:
                      # address range (from-to)
                      addr2 = ipaddress.ip_address(tmp[1])
                      for addr in ipaddress.summarize_address_range(addr1, addr2):
                          yield str(addr)
                  else:
                      yield address
                  return
              except (ipaddress.AddressValueError, ValueError):
                  pass
  
          # try to resolve provided address
          for record_type in ['A', 'AAAA']:
              try:
                  for rdata in self._dnsResolver.query(address, record_type):
                      yield str(rdata)
              except (dns.resolver.NoAnswer, dns.resolver.NXDOMAIN, dns.exception.Timeout, dns.resolver.NoNameservers):
                  pass
code_tokens: def _parse_address ( self , address ) : address = address . strip ( ) if address . find ( '/' ) > - 1 : try : ipaddress . ip_network ( unicode ( address ) , strict = False ) yield address return except ( ipaddress . AddressValueError , ValueError ) : pass else : try : tmp = unicode ( address ) . split ( '-' ) addr1 = ipaddress . ip_address ( tmp [ 0 ] ) if len ( tmp ) > 1 : addr2 = ipaddress . ip_address ( tmp [ 1 ] ) for addr in ipaddress . summarize_address_range ( addr1 , addr2 ) : yield str ( addr ) else : yield address return except ( ipaddress . AddressValueError , ValueError ) : pass for record_type in [ 'A' , 'AAAA' ] : try : for rdata in self . _dnsResolver . query ( address , record_type ) : yield str ( rdata ) except ( dns . resolver . NoAnswer , dns . resolver . NXDOMAIN , dns . exception . Timeout , dns . resolver . NoNameservers ) : pass
short_docstring: parse addresses and hostnames, yield only valid addresses and networks
short_docstring_tokens: parse addresses and hostnames yield only valid addresses and networks
comment: """ parse addresses and hostnames, yield only valid addresses and networks
              :param address: address or network
              :return: boolean
          """$SEP$# provided address could be a network$SEP$# check if address is an ipv4/6 address or range$SEP$# address range (from-to)$SEP$# try to resolve provided address