def _should_queue(self, link, referrer, rel):
scheme, netloc, path, _, _, _ = urlparse(link)<EOL>if path.endswith(self.source_extensions + self.binary_extensions +<EOL>self.excluded_extensions):<EOL><INDENT>result = False<EOL><DEDENT>elif self.skip_externals and not link.startswith(self.base_url):<EOL><INDENT>result = False<EOL><DEDENT>elif not referrer.startswith(self.base_url):<EOL><INDENT>result = False<EOL><DEDENT>elif rel not in ('<STR_LIT>', '<STR_LIT>'):<EOL><INDENT>result = False<EOL><DEDENT>elif scheme not in ('<STR_LIT:http>', '<STR_LIT>', '<STR_LIT>'):<EOL><INDENT>result = False<EOL><DEDENT>elif self._is_platform_dependent(link):<EOL><INDENT>result = False<EOL><DEDENT>else:<EOL><INDENT>host = netloc.split('<STR_LIT::>', <NUM_LIT:1>)[<NUM_LIT:0>]<EOL>if host.lower() == '<STR_LIT:localhost>':<EOL><INDENT>result = False<EOL><DEDENT>else:<EOL><INDENT>result = True<EOL><DEDENT><DEDENT>logger.debug('<STR_LIT>', link, rel,<EOL>referrer, result)<EOL>return result<EOL>
Determine whether a link URL from a referring page and with a
particular "rel" attribute should be queued for scraping.