<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def validate_examples(self, fail_fn):
 """Check the examples against the schema. :param fail_fn: Pass failure messages to this function :type fail_fn: function(str) """

        for collection, doc in self.examples():
            _log.debug("validating example in collection {}".format(collection))
            sch = schema.get_schema(collection)  # with more err. checking
            result = sch.validate(doc)
            _log.debug("validation result: {}".format("OK" if result is None else result))
            if result is not None:
                fail_fn("Failed to validate sample document: {}".format(result))