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
"""Cool histograms from your gmail account. | |
Remember to turn on IMAP, and if you're using two-steps verification | |
(you should) you'll have to request a password just for this (security | |
"tab" of your account configuration). | |
""" | |
from collections import Counter | |
from itertools import izip | |
import imaplib |
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 numpy as np | |
from scipy.weave import blitz | |
import numpy.testing as npt | |
def test_blitz_bug(): | |
"""Assignment to arr[i:] fails inside blitz expression.""" | |
N = 4 | |
expr_buggy = 'arr_blitz_buggy[{0}:] = arr[{0}:]' | |
expr_not_buggy = 'arr_blitz_not_buggy[{0}:{1}] = arr[{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
#include <climits> | |
const int toEnd = INT_MAX; |
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 -*- | |
from __future__ import unicode_literals | |
import matplotlib | |
matplotlib.use('webagg') | |
import numpy as np | |
from scipy.special import binom | |
import matplotlib.pyplot as plt |
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:15a77094831f2163897dc9869989c73223affe2cdbe64be9ce7f3fde40511f15" | |
}, | |
"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
import unittest | |
import tempfile | |
from StringIO import StringIO | |
from util import open_filepath_or, _is_string_or_bytes | |
class TestFilePathOpening(unittest.TestCase): | |
def test_is_string_or_bytes(self): | |
self.assertTrue(_is_string_or_bytes('foo')) |