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
print('Hello Gist!') |
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 route(rule, **options): | |
def decorator(f): | |
print(options) | |
print('do something') | |
return f | |
return decorator | |
@route('/index', method='POST') | |
def index(): |
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 os | |
# import cv2 | |
def read_image(file_path): | |
# cv2.read(file_path, 1) # grayscale | |
pass | |
def traverse_dir(path): |
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 tensorflow.examples.tutorials.mnist import input_data | |
import tensorflow as tf | |
mnist = input_data.read_data_sets('MNIST_data', one_hot=True) | |
sess = tf.InteractiveSession() | |
x = tf.placeholder(tf.float32, shape=[None, 784]) | |
y_ = tf.placeholder(tf.float32, shape=[None, 10]) | |
W = tf.Variable(tf.zeros([784,10])) | |
b = tf.Variable(tf.zeros([10])) |
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
# -*- coding: utf-8 -*- | |
import datetime | |
from collections import defaultdict | |
import dateutil.parser | |
from application.google_calendar import get_upcoming_events | |
def extract_intervals(events_list): | |
intervals = defaultdict(list) |
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
# -*- coding: utf-8 -*- | |
import datetime | |
from collections import defaultdict | |
import dateutil.parser | |
from application.google_calendar import get_upcoming_events | |
def extract_intervals(events_list): | |
intervals = defaultdict(list) |
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
# -*- coding: utf-8 -*- | |
import json | |
from collections import defaultdict | |
from pathlib import Path | |
def find_corpus_fileids(root, regexp): | |
p = Path(root) | |
return list(p.glob(regexp)) |
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
1444062497 | |
284862083 | |
762630884 | |
1188614369 | |
1104161854 | |
1280855887 | |
586449534 | |
1206728554 | |
468429333 | |
566799704 |
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
#!/bin/bash | |
REGION=us-east-1 | |
RUNTIME=python3.7 | |
while getopts :n:r:p: OPT | |
do | |
case $OPT in | |
n) PACKAGE=$OPTARG;; | |
r) REGION=$OPTARG;; | |
p) RUNTIME=$OPTARG;; |
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 os | |
import urllib.request | |
import spacy | |
import tarfile | |
from pathlib import Path | |
def maybe_download(model, dest): | |
save_path = Path(dest) / model | |
if not os.path.exists(save_path): |
OlderNewer