code: def extend_with_default(validator_class):
      
      validate_properties = validator_class.VALIDATORS["properties"]
  
      def set_defaults(validator, properties, instance, schema):
          """
          Set defaults in subschemas
          """
          for prop, subschema in properties.items():
              if "default" in subschema:
                  instance.setdefault(prop, subschema["default"])
  
          for error in validate_properties(validator, properties, instance, schema):
              yield error
  
      return validators.extend(validator_class, {"properties": set_defaults})
docs: Add a default-setting mechanism to a ``jsonschema`` validation class.