nodes: 0, module; 1, function_definition; 2, function_name:render_config; 3, parameters; 4, type; 5, block; 6, typed_parameter; 7, typed_default_parameter; 8, identifier:str; 9, expression_statement; 10, comment:# Add four spaces to the indent.; 11, expression_statement; 12, return_statement; 13, identifier:config; 14, type; 15, identifier:indent; 16, type; 17, string:""; 18, comment:"""
      Pretty-print a config in sort-of-JSON+comments.
      """; 19, assignment; 20, call; 21, identifier:Config; 22, identifier:str; 23, identifier:new_indent; 24, binary_operator:indent + "    "; 25, attribute; 26, argument_list; 27, identifier:indent; 28, string:"    "; 29, string:""; 30, identifier:join; 31, list; 32, comment:# opening brace + newline; 33, string:"{\n"; 34, comment:# "type": "...", (if present); 35, conditional_expression:f'{new_indent}"type": "{config.typ3}",\n' if config.typ3 else ''; 36, comment:# render each item; 37, call; 38, comment:# indent and close the brace; 39, identifier:indent; 40, string:"}\n"; 41, string:f'{new_indent}"type": "{config.typ3}",\n'; 42, attribute; 43, string; 44, attribute; 45, generator_expression; 46, identifier:config; 47, identifier:typ3; 48, string:""; 49, identifier:join; 50, call; 51, for_in_clause; 52, identifier:_render; 53, argument_list; 54, identifier:item; 55, attribute; 56, identifier:item; 57, identifier:new_indent; 58, identifier:config; 59, identifier:items
code: def render_config(config: Config, indent: str = "") -> str:
      """
      Pretty-print a config in sort-of-JSON+comments.
      """
      # Add four spaces to the indent.
      new_indent = indent + "    "
  
      return "".join([
              # opening brace + newline
              "{\n",
              # "type": "...", (if present)
              f'{new_indent}"type": "{config.typ3}",\n' if config.typ3 else '',
              # render each item
              "".join(_render(item, new_indent) for item in config.items),
              # indent and close the brace
              indent,
              "}\n"
      ])