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 matplotlib.pyplot as plt | |
def save(path, ext='png', close=True, verbose=True): | |
"""Save a figure from pyplot. | |
Parameters | |
---------- | |
path : string | |
The path (and filename, without the extension) to save the |
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
class Pet(object): | |
def __init__(self, name, species): | |
self.name = name | |
self.species = species | |
def getName(self): | |
return self.name | |
def getSpecies(self): |
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 timeit import Timer | |
import numpy as np | |
import math | |
def timer(*funcs): | |
# find the maximum function name length | |
if len(funcs) > 1: | |
maxlen = max(*[len(func) for func in funcs]) | |
elif len(funcs) == 1: | |
maxlen = len(funcs[0]) |
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 1ebff43a47eea78643a903d85b13c91eb94d1e76 Mon Sep 17 00:00:00 2001 | |
From: "Jessica B. Hamrick" <[email protected]> | |
Date: Mon, 15 Apr 2013 16:51:38 -0700 | |
Subject: [PATCH] Look for OmniGraffle Professional 5 if OmniGraffle 5 does not | |
exist | |
--- | |
omnigraffle_export/omnigraffle.py | 5 ++++- | |
1 file changed, 4 insertions(+), 1 deletion(-) |
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 update_docstring(name, olddoc): | |
# make sure it has a docstring | |
if olddoc is None: | |
return None | |
# new docstring | |
prefix = "%s: " % name | |
if len(olddoc.split(": ")) > 1: | |
newdoc = prefix + olddoc.split(": ")[1] | |
else: |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
"""Convert 'tower of blocks' CPO files to SSO files.""" | |
# Standard | |
import os | |
import re | |
import colorsys | |
import sys | |
import pickle | |
# External | |
from path import path | |
import numpy as np |
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
# A template to demonstrate why we need to profile | |
# This instance written by Paul Ivanov (XXX: put your name / github id here) | |
import numpy as np | |
import random | |
def where_is_the_bottleneck(x): | |
return [random.randint(0, 100) for i in xrange(x)] |
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
{ | |
"metadata": { | |
"name": "", | |
"signature": "sha256:68dde4e98d73981470a2678c04c4a291b230afea11aa551a38bac92ec836e42e" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ |
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
#!/usr/bin/env python | |
"""Extend HITs as assignments are completed. | |
If a HIT takes up a lot of bandwidth, then you may only want to have a | |
few workers doing it at a time. This script monitors how many | |
assignments are currently being worked on, and as they are completed, | |
extends the HIT with new assignments until a specified upper limit is | |
reached. |
OlderNewer