This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import Counter | |
import math | |
from string import punctuation | |
from typing import List | |
from nltk.tokenize import word_tokenize | |
import nltk | |
nltk.download("punkt") | |
test_corpus = ["The quick, brown fox jumps, over the lazy dog.", "Never jump over the lazy dog quickly."] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import List, Tuple | |
import pytest | |
def binary_search(desired_member:Tuple[int, float], sorted_list:List[Tuple[int, float]]) -> int: | |
"""perform binary search over sorted list, return index of desired member""" | |
# check parameter type | |
if not (type(desired_member) is int or type(desired_member) is float): | |
raise TypeError("desired_member must be a number") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~/code/my_repo $ git checkout master | |
~/code/my_repo $ git merge dev | |
~/code/my_repo $ git push origin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~/code/my_repo $ git add . | |
~/code/my_repo $ git commit -m "helpful, short commit message" . | |
~/code/my_repo $ git push origin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cd ~/code # or wherever you work on code | |
~/code $ gcloud source repos clone my_repo | |
~/code $ cd my_repo | |
~/code/my_repo $ git checkout -B dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
POOR NAME | COMMENT | BETTER NAME | |
---|---|---|---|
FlaskPredictionService | What if you switch from Flask to Lambda? | ProductRecommendationService | |
repo_chris | Indicate the business concern | UserSessionAnalysis | |
graph-analytics | Model class could change; naming convention | InfluencerMetrics |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# .gitignore | |
__pycache__ | |
.ipynb* |