original_docstring:  return unparsed (raw) alias entries without dependencies
              :param url: url
              :return: iterator
          
docstring: return unparsed (raw) alias entries without dependencies
docstring_tokens: return unparsed ( raw ) alias entries without dependencies
code: def _fetch_url(self, url):
          """ return unparsed (raw) alias entries without dependencies
              :param url: url
              :return: iterator
          """
          # set request parameters
          req_opts = dict()
          req_opts['url'] = url
          req_opts['stream'] = True
          req_opts['timeout'] = self._timeout
          if self._ssl_no_verify:
              req_opts['verify'] = False
          # fetch data
          try:
              req = requests.get(**req_opts)
              if req.status_code == 200:
                  # only handle content if response is correct
                  req.raw.decode_content = True
                  lines = req.raw.read().splitlines()
                  if len(lines) > 100:
                      # when larger alias lists are downloaded, make sure we log before handling.
                      syslog.syslog(syslog.LOG_ERR, 'fetch alias url %s (lines: %s)' % (url, len(lines)))
                  for line in lines:
                      raw_address = re.split(r'[\s,;|#]+', line)[0]
                      if raw_address and not raw_address.startswith('//'):
                          for address in self._parse_address(raw_address):
                              yield address
              else:
                  syslog.syslog(syslog.LOG_ERR, 'error fetching alias url %s [http_code:%s]' % (url, req.status_code))
                  raise IOError('error fetching alias url %s' % (url))
          except:
              syslog.syslog(syslog.LOG_ERR, 'error fetching alias url %s' % (url))
              raise IOError('error fetching alias url %s' % (url))
code_tokens: def _fetch_url ( self , url ) : req_opts = dict ( ) req_opts [ 'url' ] = url req_opts [ 'stream' ] = True req_opts [ 'timeout' ] = self . _timeout if self . _ssl_no_verify : req_opts [ 'verify' ] = False try : req = requests . get ( ** req_opts ) if req . status_code == 200 : req . raw . decode_content = True lines = req . raw . read ( ) . splitlines ( ) if len ( lines ) > 100 : syslog . syslog ( syslog . LOG_ERR , 'fetch alias url %s (lines: %s)' % ( url , len ( lines ) ) ) for line in lines : raw_address = re . split ( r'[\s,;|#]+' , line ) [ 0 ] if raw_address and not raw_address . startswith ( '//' ) : for address in self . _parse_address ( raw_address ) : yield address else : syslog . syslog ( syslog . LOG_ERR , 'error fetching alias url %s [http_code:%s]' % ( url , req . status_code ) ) raise IOError ( 'error fetching alias url %s' % ( url ) ) except : syslog . syslog ( syslog . LOG_ERR , 'error fetching alias url %s' % ( url ) ) raise IOError ( 'error fetching alias url %s' % ( url ) )
short_docstring: return unparsed (raw) alias entries without dependencies
short_docstring_tokens: return unparsed ( raw ) alias entries without dependencies
comment: """ return unparsed (raw) alias entries without dependencies
              :param url: url
              :return: iterator
          """$SEP$# set request parameters$SEP$# fetch data$SEP$# only handle content if response is correct$SEP$# when larger alias lists are downloaded, make sure we log before handling.