Skip to content

Instantly share code, notes, and snippets.

View junhoseo0's full-sized avatar

JunHo Seo junhoseo0

View GitHub Profile
@junhoseo0
junhoseo0 / graph.py
Created June 16, 2023 04:19
Transition Graph
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),
@junhoseo0
junhoseo0 / env.yaml
Last active June 16, 2023 04:24
Google StreetView Exploration in Python
name: pathfind
channels:
- conda-forge
dependencies:
- python=3.11
- pip=23.0.1
- pip:
# Environment
- requests
- selenium
@junhoseo0
junhoseo0 / yugioh_calc.py
Created May 8, 2022 20:55
Yu-Gi-Oh! Opening Simulation
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]:
@junhoseo0
junhoseo0 / papago.py
Created September 21, 2020 12:39
Example of Naver's Papago Translate API
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 = {
@junhoseo0
junhoseo0 / DisplayMNIST.py
Created August 3, 2020 06:29
Read and display single image from MNIST dataset
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()