code: def write_data_validator_py(outdir, base_trace_node: TraceNode):
      """
      Construct and write out the DataValidator
      (this is the validator that inputs a list of traces)
  
      Parameters
      ----------
      outdir : str
          Root outdir in which the top-level validators package should reside
      base_trace_node : PlotlyNode
          PlotlyNode that is the parent of all of the individual trace nodes
      Returns
      -------
      None
      """
      # Validate inputs
      # ---------------
      if base_trace_node.node_path:
          raise ValueError(
              "Expected root trace node.\n"
              'Received node with path "%s"' % base_trace_node.path_str
          )
  
      # Build Source
      # ------------
      source = build_data_validator_py(base_trace_node)
  
      # Write file
      # ----------
      # filepath = opath.join(outdir, "validators", "__init__.py")
      filepath = opath.join(outdir, "validators", "_data.py")
      write_source_py(source, filepath, leading_newlines=2)
  
file_path: plotly.py/packages/python/plotly/codegen/validators.py
imports: import os.path
  from io import StringIO
  import _plotly_utils.basevalidators
  from codegen.utils import PlotlyNode, TraceNode, write_source_py
label_desc: Use image node_id 6 for calling a global function with example usage: write_data_validator_py(outdir, base_trace_node) without return types