human
Complete the below
def extend_with_default(validator_class):

    ''''Add support for the \'default\' attr for properties and patternProperties.
    jsonschema does not handle this out of the box -- it only
    validates.  This allows us to set default values for configs
    where certain fields are `None` b/c they\'re deleted or
    commented out.'
    '''
 ... Can you provide a the Python code you requested?
assistant
#Here is the Python code you requested.
    validate_properties = validator_class.VALIDATORS['properties']
    validate_pattern_properties = validator_class.VALIDATORS['patternProperties']
    def set_defaults(validator, properties, instance, schema):
        for (property, subschema) in iteritems(properties):
            if ('default' in subschema):
                instance.setdefault(property, subschema['default'])
        for err in validate_properties(validator, properties, instance, schema):
            (yield err)
    def set_pp_defaults(validator, properties, instance, schema):
        for (property, subschema) in iteritems(properties):
            if ('default' in subschema):
                if isinstance(instance, dict):
                    for (key, val) in iteritems(instance):
                        if (re.match(property, key) and (val is None)):
                            instance[key] = subschema['default']
        for err in validate_pattern_properties(validator, properties, instance, schema):
            (yield err)
    return validators.extend(validator_class, {'properties': set_defaults, 'patternProperties': set_pp_defaults})