code: def write_deprecated_datatypes(outdir):
      """
      Build source code for deprecated datatype class definitions and write
      them to a file
  
      Parameters
      ----------
      outdir :
          Root outdir in which the graph_objs package should reside
  
      Returns
      -------
      None
      """
      # Generate source code
      # --------------------
      datatype_source = build_deprecated_datatypes_py()
      filepath = opath.join(outdir, "graph_objs", "_deprecations.py")
  
      # Write file
      # ----------
      write_source_py(datatype_source, filepath)
  
imports: from io import StringIO
  from os import path
  from codegen.utils import write_source_py
label_desc: Use image node_id 3 for calling a global function with example usage: write_deprecated_datatypes(outdir) without return types