start new:
tmux
start new with session name:
tmux new -s myname
| import pyeliza | |
| class Eliza: | |
| aliases = 'eliza' | |
| description = 'Virtual therapist' | |
| _therapist = pyeliza.eliza() | |
| def execute(self, expression, context): | |
| ''' | |
| >>> from mock import Mock |
| import pygame, sys, random, math | |
| from pygame.locals import * | |
| # set up game | |
| pygame.init() | |
| mainClock = pygame.time.Clock() | |
| # create window | |
| WINDOWWIDTH = 600 | |
| WINDOWHEIGHT = 600 |
| import numpy as np | |
| import scipy.linalg.blas | |
| cdef extern from "f2pyptr.h": | |
| void *f2py_pointer(object) except NULL | |
| ctypedef int dgemm_t( | |
| char *transa, char *transb, | |
| int *m, int *n, int *k, | |
| double *alpha, |
| """A simple implementation of a greedy transition-based parser. Released under BSD license.""" | |
| from os import path | |
| import os | |
| import sys | |
| from collections import defaultdict | |
| import random | |
| import time | |
| import pickle | |
| SHIFT = 0; RIGHT = 1; LEFT = 2; |
| {0: 'tench, Tinca tinca', | |
| 1: 'goldfish, Carassius auratus', | |
| 2: 'great white shark, white shark, man-eater, man-eating shark, Carcharodon carcharias', | |
| 3: 'tiger shark, Galeocerdo cuvieri', | |
| 4: 'hammerhead, hammerhead shark', | |
| 5: 'electric ray, crampfish, numbfish, torpedo', | |
| 6: 'stingray', | |
| 7: 'cock', | |
| 8: 'hen', | |
| 9: 'ostrich, Struthio camelus', |
| """ Trains an MNIST classifier using Synthetic Gradients. See Google DeepMind paper @ arxiv.org/abs/1608.05343. """ | |
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| import matplotlib.cm as cm | |
| from tensorflow.examples.tutorials.mnist import input_data # just use tensorflow's mnist api | |
| mnist = input_data.read_data_sets('MNIST_data', one_hot=False) | |
| # hyperparameters | |
| global_step = 0 | |
| batch_size = 10 |
| import numpy as np | |
| import tensorflow as tf | |
| import scipy | |
| from tensorflow.contrib.eager.python import tfe | |
| tfe.enable_eager_execution() | |
| # manual numpy example | |
| # X = np.array(([[0., 1], [2, 3]])) | |
| # W0 = X | |
| # W1 = np.array(([[0., 1], [2, 3]]))/10 |
| ### JHW 2018 | |
| import numpy as np | |
| import umap | |
| # This code from the excellent module at: | |
| # https://stackoverflow.com/questions/4643647/fast-prime-factorization-module | |
| import random |