original_docstring: Calculates the priority number of a url.
docstring: Calculates the priority number of a url.
docstring_tokens: Calculates the priority number of a url .
code: def calculate_priority(self, url):
          """Calculates the priority number of a url."""
  
          base = 750
          domain = urlparse(url).netloc
  
          if domain in self.bad_domains:
              base = 1250
          elif domain in self.good_domains:
              base = 50
          elif domain in self.crawler.tmr:
              base = 1000
          elif 'cat' in url:
              base = 749
  
          try:
              score = base + self.domain_priority[domain]
              if score < 0:
                  self.domain_priority[domain] = -base + 1
          except KeyError:
              self.domain_priority[domain] = 0
              score = base
  
          return score if score > 0 else 0
code_tokens: def calculate_priority ( self , url ) : base = 750 domain = urlparse ( url ) . netloc if domain in self . bad_domains : base = 1250 elif domain in self . good_domains : base = 50 elif domain in self . crawler . tmr : base = 1000 elif 'cat' in url : base = 749 try : score = base + self . domain_priority [ domain ] if score < 0 : self . domain_priority [ domain ] = - base + 1 except KeyError : self . domain_priority [ domain ] = 0 score = base return score if score > 0 else 0
short_docstring: Calculates the priority number of a url.
short_docstring_tokens: Calculates the priority number of a url .
comment: """Calculates the priority number of a url."""