code: def add_constructor_params(
      buffer,
      subtype_nodes,
      prepend_extras=(),
      append_extras=(),
      output_type=None,
  ):
      """
      Write datatype constructor params to a buffer
  
      Parameters
      ----------
      buffer : StringIO
          Buffer to write to
      subtype_nodes : list of PlotlyNode
          List of datatype nodes to be written as constructor params
      prepend_extras : list[str]
          List of extra parameters to include at the beginning of the params
      append_extras : list[str]
          List of extra parameters to include at the end of the params
      Returns
      -------
      None
      """
      for extra in prepend_extras:
          buffer.write(
              f""",
              {extra}=None"""
          )
  
      for i, subtype_node in enumerate(subtype_nodes):
          buffer.write(
              f""",
              {subtype_node.name_property}=None"""
          )
  
      for extra in append_extras:
          buffer.write(
              f""",
              {extra}=None"""
          )
  
      buffer.write(
          """,
              **kwargs"""
      )
      buffer.write(
          """
          )"""
      )
      if output_type:
          buffer.write(f"-> '{output_type}'")
      buffer.write(":")
  
file_path: plotly.py/packages/python/plotly/codegen/datatypes.py
imports: import os.path
  import textwrap
  from io import StringIO
  from codegen.utils import PlotlyNode, write_source_py
label_desc: Use image node_id 4 for calling a global function with example usage: add_constructor_params(buffer, subtype_nodes, prepend_extras, append_extras, output_type) without return types