Hi, nice job.<p>A few unsolicited code tips that seem to come up often if I may:<p>- `if <somestuff>: return True; else: return False` is always best spelled `return <somestuff>`<p>- You only need the global statement when you want to <i>assign</i> to a global, not access one<p>- `foo = d["bla"] if "bla" in d else None` is just `foo = d.get("bla")`<p>- You have mutable default args. They probably are not what you want. See <a href="http://docs.python-guide.org/en/latest/writing/gotchas/#mutable-default-arguments" rel="nofollow">http://docs.python-guide.org/en/latest/writing/gotchas/#muta...</a> for e.g. for an explanation.<p>- Lots of your dicts with enumerates to set indices should just probably be lists<p>If I get a chance later I'll try to throw together a quick pull request, but otherwise, thanks for sharing.