I hereby claim:
- I am kstrauser on github.
- I am ks (https://keybase.io/ks) on keybase.
- I have a public key whose fingerprint is 19CF F48E 5C06 16B4 4A15 1E80 54D9 906A 294B 7FF3
To claim this, I am signing this object:
""" | |
Requirements: | |
* A Wordpress Blog | |
* Ghost export file (json). | |
* Python Packages: python-wordpress-xmlrpc | |
>>> pip install python-wordpress-xmlrpc | |
WARNING: |
>>> import mock | |
>>> m = mock.Mock() | |
>>> m.assert_called_once() # Old version of Mock? This may not be what you expect. | |
<Mock name='mock.assert_called_once()' id='4558624144'> | |
>>> assert_called_once = mock.Mock.assert_called_once # Doesn't exist. Now you know! | |
Traceback (most recent call last): | |
File "<stdin>", line 1, in <module> | |
AttributeError: type object 'Mock' has no attribute 'assert_called_once' |
from itertools import count | |
def fizz(): | |
for i in count(1): | |
yield '' if i % 3 else 'fizz' | |
def buzz(): | |
for i in count(1): | |
yield '' if i % 5 else 'buzz' |
I hereby claim:
To claim this, I am signing this object:
#!/usr/bin/env python | |
""" | |
Build wheels of all currently installed packages (as listed by "pip freeze") | |
""" | |
import glob | |
import importlib | |
from subprocess import call |
I use this decorator in unittest modules to verify that a particularly-named object exists:
def existsin(namespace):
"""Given a namespace, this decorator asserts that an object with
the same name as the function it's wrapping (minus ) exists in that
namespace"""
def wrapper(namedunittest):
assert namedunittest.__name__.startswith('test_'), \
"The wrapped '%s' function doesn't look like a unit test" % namedunittest.__name__
def substrcomparatormaker(column, i, j=None): | |
"""Return a comparator that tests for the substring of 'column' | |
from 'i' to 'j', as specified with Python slice values. This | |
means setting the start column to i + 1 because Python is 0-based | |
and SQL is 1-based, and setting the length to j - i. | |
Please don't create new tables that use this! It's only for legacy, | |
unnormalized data where multiple values are lumped together in a single | |
column. |