🤬
  • ■ ■ ■ ■ ■ ■
    isp_data_pollution.py
    skipped 497 lines
    498 498   urls.append(url)
    499 499   else:
    500 500   k = int(np.nonzero(cnts)[0])
    501  - domain = domain_count[k][0]
     501 + domain = domain_array[k]
    502 502   url = random.sample(self.domain_links[domain],1)[0]
    503 503   urls.append(url)
    504 504   return urls
    skipped 140 lines
    645 645   
    646 646   def print_progress(self,num_links,url,terminal_width=80):
    647 647   # truncate or fill with white space
    648  - text_suffix = ': +{:d} of {:d} links, H(domain) = {:.1f} b'.format(num_links,self.link_count(),self.domain_entropy())
     648 + text_suffix = ': +{:d}/{:d} links, H(domain)={:.1f} b'.format(num_links,self.link_count(),self.domain_entropy())
    649 649   chars_used = 2 + len(text_suffix)
    650 650   if len(url) + chars_used > terminal_width:
    651 651   url = url[:terminal_width-chars_used-1] + '…'
    skipped 104 lines
Please wait...
Page is in error, reload to recover