def METHOD_NAME(self, obj: Any, level: int, types: Set[Type]):
    yield f"{obj.__class__.__qualname__}(\n"
    next_level = level + 1
    index = 0
    for f in self.context.class_type.get_fields(obj):
        if not f.init:
            continue
        value = getattr(obj, f.name, types)
        default = self.context.class_type.default_value(f, default=unset)
        if default is not unset and (
            (callable(default) and default() == value) or default == value
        ):
            continue
        if index:
            yield f",\n{spaces * next_level}{f.name}="
        else:
            yield f"{spaces * next_level}{f.name}="
        yield from self.write_object(value, next_level, types)
        index += 1
    yield f"\n{spaces * level})"