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
print('Hello Gist!') |
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
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 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 os | |
# import cv2 | |
def read_image(file_path): | |
# cv2.read(file_path, 1) # grayscale | |
pass | |
def traverse_dir(path): |
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 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 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
# -*- 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 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
# -*- 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 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 numpy as np | |
from keras.preprocessing import sequence | |
from keras.models import Sequential | |
from keras.layers import Dense, Embedding | |
from keras.layers import LSTM | |
from keras.datasets import imdb | |
def batch_iter(data, labels, batch_size, shuffle=True): | |
num_batches_per_epoch = int((len(data) - 1) / batch_size) + 1 |
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
# -*- coding: utf-8 -*- | |
import os | |
# Load api keys. | |
consumer_key = os.environ.get('CONSUMER_KEY') | |
consumer_secret = os.environ.get('CONSUMER_SECRET') | |
access_token = os.environ.get('ACCESS_TOKEN') | |
access_token_secret = os.environ.get('ACCESS_TOKEN_SECRET') | |
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
# -*- 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 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
1444062497 | |
284862083 | |
762630884 | |
1188614369 | |
1104161854 | |
1280855887 | |
586449534 | |
1206728554 | |
468429333 | |
566799704 |
OlderNewer