code: def build_data_validator_py(base_trace_node: TraceNode):
      """
      Build source code for the DataValidator
      (this is the validator that inputs a list of traces)
  
      Parameters
      ----------
      base_trace_node : PlotlyNode
          PlotlyNode that is the parent of all of the individual trace nodes
      Returns
      -------
      str
          Source code string for DataValidator class
      """
  
      # Get constructor params
      # ----------------------
      params = build_data_validator_params(base_trace_node)
  
      # Build source code
      # -----------------
      buffer = StringIO()
  
      buffer.write(
          f"""
  import _plotly_utils.basevalidators
  
  class DataValidator(_plotly_utils.basevalidators.BaseDataValidator):
  
      def __init__(self, plotly_name={params['plotly_name']},
                         parent_name={params['parent_name']},
                         **kwargs):
  
          super(DataValidator, self).__init__(class_strs_map={params['class_strs_map']},
                           plotly_name=plotly_name,
                           parent_name=parent_name,
                           **kwargs)"""
      )
  
      return buffer.getvalue()
  
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 4 for calling a global function with example usage: build_data_validator_py(base_trace_node) and returns: buffer