MCPcopy Index your code
hub / github.com/clips/pattern / priority

Method priority

pattern/web/__init__.py:3236–3247  ·  view source on GitHub ↗

Called from Crawler.crawl() to determine the priority of this link, as a number between 0.0-1.0. Links with higher priority are visited first.

(self, link, method=DEPTH)

Source from the content-addressed store, hash-verified

3234 return True
3235
3236 def priority(self, link, method=DEPTH):
3237 """ Called from Crawler.crawl() to determine the priority of this link,
3238 as a number between 0.0-1.0. Links with higher priority are visited first.
3239 """
3240 # Depth-first search dislikes external links to other (sub)domains.
3241 external = base(link.url) != base(link.referrer)
3242 if external is True:
3243 if method == DEPTH:
3244 return 0.75
3245 if method == BREADTH:
3246 return 0.85
3247 return 0.80
3248
3249 def visit(self, link, source=None):
3250 """ Called from Crawler.crawl() when the link is crawled.

Callers 1

crawlMethod · 0.95

Calls 1

baseFunction · 0.70

Tested by

no test coverage detected