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
import json | |
def save_data(data: dict, config: DictConfig): | |
with open(config.data.raw, "w") as file: | |
json.dump(data, file) |
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
{ | |
"id": 507959643, | |
"node_id": "R_kgDOHkbZWw", | |
"name": "prize", | |
"full_name": "inverse-scaling/prize", | |
"private": false, | |
"owner": { | |
"login": "inverse-scaling", | |
"id": 107094088, | |
"node_id": "U_kgDOBmIgSA", |
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
def get_specific_info_of_repos(auth: dict, repo_urls: list): | |
data = [] | |
for url in repo_urls: | |
response = requests.get( | |
url, | |
auth=(auth["username"], auth["token"]), | |
) | |
data.append(response.json()) | |
return data |
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 pydash import py_ | |
def get_starred_repo_urls(data: list): | |
return py_(data).filter({"type": "WatchEvent"}).map("repo.url").value() |
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
.env |
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 dotenv import load_dotenv | |
def get_authentication(): | |
load_dotenv() | |
username = os.getenv("username") | |
token = os.getenv("token") | |
return {"username": username, "token": token} |
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
import requests | |
def get_general_info_of_repos(auth: dict): | |
response = requests.get( | |
f"https://api.github.com/users/{auth['username']}/received_events/public?per_page=100", | |
auth=(auth["username"], auth["token"]), | |
) | |
data = response.json() | |
return data |
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
// Future versions of Hyper may add additional config options, | |
// which will not automatically be merged into this file. | |
// See https://hyper.is#cfg for all currently supported options. | |
module.exports = { | |
config: { | |
// choose either `'stable'` for receiving highly polished, | |
// or `'canary'` for less polished but more frequent updates | |
updateChannel: 'stable', |
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
# If you come from bash you might have to change your $PATH. | |
# export PATH=$HOME/bin:/usr/local/bin:$PATH | |
# Path to your oh-my-zsh installation. | |
export ZSH="/Users/khuyen/.oh-my-zsh" | |
# Path to VSCOde | |
export PATH="$PATH:/Applications/Visual Studio Code.app/Contents/Resources/app/bin" | |
export PATH="$PATH:/Library/Python/3.9/lib/python/site-packages" |
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 pandera import check_input | |
@check_input(schema) | |
def get_total_price(fruits: pd.DataFrame): | |
return fruits.price.sum() | |
get_total_price(fruits) |