This file contains hidden or 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 pathfind.data.dataset import PathFindRawDataset | |
ds = PathFindRawDataset("./data/raw") | |
G = ds.transition_graph | |
degree = dict(G.degree()) | |
errors = [(coord, degree[coord]) for coord in degree if degree[coord] > 4] | |
""" | |
[((42.3600388, -71.0599952, 329.99), 26), | |
((42.3601946, -71.0601172, 329.99), 20), |
This file contains hidden or 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
name: pathfind | |
channels: | |
- conda-forge | |
dependencies: | |
- python=3.11 | |
- pip=23.0.1 | |
- pip: | |
# Environment | |
- requests | |
- selenium |
This file contains hidden or 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 copy | |
def reduce_deck(opening, deck): | |
return deck - opening | |
def ihmr(opening, deck, req): # in hand min requirement | |
result = True | |
for card in req: | |
if opening[card] < req[card]: |
This file contains hidden or 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 translate(sentence, client_id, client_secret): | |
url = 'https://openapi.naver.com/v1/papago/n2mt' | |
headers = { | |
'X-Naver-Client-Id': client_id, | |
'X-Naver-Client-Secret': client_secret | |
} | |
data = { |
This file contains hidden or 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 argparse | |
import io, os | |
import numpy as np | |
from PIL import Image | |
parser = argparse.ArgumentParser(usage="Display images from MNIST dataset") | |
parser.add_argument("image_file", type=str) | |
parser.add_argument("index", type=int) | |
args = parser.parse_args() |