code: def markdown_as_class_with_fields(
      obj: Any, fields: dict[str, str], set_defaults: bool = True
  ) -> str:
      if set_defaults:
          # add default properties to start of the dict
          fields = {**{"id": obj.id}, **fields}
      _repr_str = f"class {obj.__class__.__name__}:\n  "
      _repr_str += "\n  ".join([f"{k}: {v}" for k, v in fields.items()])
      return as_markdown_python_code(_repr_str)
  
imports: from typing import Any
label_desc: Use image node_id 3 for calling a global function with example usage: markdown_as_class_with_fields(obj, fields, set_defaults) and returns: as_markdown_python_code