I mean you could use the [operator module](http://docs.python.org/2/library/operator.html) from the standard library. All of these functions could be replaced with one line that just does a `getattr` on the operator module for the key from the JSON. It would mean changing "matches" to "contains" but I think that's about it. That's probably the right thing to do anyway, since unless matches is going to be a regexp it really is just a contains and in python "a.find(b) > -1" is probably exactly the same as "b in a" for most types.