From this docstring it's unclear what kind of function f is, or what format is.  From the usage below I presume it's the string that I put in the format key of the jsonschema string type?