mirror of
https://github.com/donnemartin/system-design-primer.git
synced 2025-12-15 17:38:56 +03:00
Convert all .py files to be valid Python
`raise NotImplementedError('Please replace this line with your code...')` signals to the user where they need to put their code.
This approach enables the codebase to be tested with lint tools like flake8, pyflakes, pylint, etc.
This commit is contained in:
@@ -61,3 +61,4 @@ class UserGraphService(object):
|
||||
def bfs(self, source, dest):
|
||||
# Use self.visited_ids to track visited nodes
|
||||
# Use self.lookup to translate a person_id to a Person
|
||||
pass
|
||||
|
||||
@@ -2,33 +2,33 @@
|
||||
|
||||
class PagesDataStore(object):
|
||||
|
||||
def __init__(self, db);
|
||||
def __init__(self, db):
|
||||
self.db = db
|
||||
...
|
||||
pass
|
||||
|
||||
def add_link_to_crawl(self, url):
|
||||
"""Add the given link to `links_to_crawl`."""
|
||||
...
|
||||
pass
|
||||
|
||||
def remove_link_to_crawl(self, url):
|
||||
"""Remove the given link from `links_to_crawl`."""
|
||||
...
|
||||
pass
|
||||
|
||||
def reduce_priority_link_to_crawl(self, url)
|
||||
def reduce_priority_link_to_crawl(self, url):
|
||||
"""Reduce the priority of a link in `links_to_crawl` to avoid cycles."""
|
||||
...
|
||||
pass
|
||||
|
||||
def extract_max_priority_page(self):
|
||||
"""Return the highest priority link in `links_to_crawl`."""
|
||||
...
|
||||
pass
|
||||
|
||||
def insert_crawled_link(self, url, signature):
|
||||
"""Add the given link to `crawled_links`."""
|
||||
...
|
||||
pass
|
||||
|
||||
def crawled_similar(self, signature):
|
||||
"""Determine if we've already crawled a page matching the given signature"""
|
||||
...
|
||||
pass
|
||||
|
||||
|
||||
class Page(object):
|
||||
@@ -41,7 +41,7 @@ class Page(object):
|
||||
|
||||
def create_signature(self):
|
||||
# Create signature based on url and contents
|
||||
...
|
||||
pass
|
||||
|
||||
|
||||
class Crawler(object):
|
||||
|
||||
Reference in New Issue
Block a user