code: def analyze(
      train_data: Optional[pd.DataFrame] = None,
      test_data: Optional[pd.DataFrame] = None,
      val_data: Optional[pd.DataFrame] = None,
      model=None,
      label: Optional[str] = None,
      state: Union[None, dict, AnalysisState] = None,
      sample: Union[None, int, float] = DEFAULT_SAMPLE_SIZE,
      anlz_facets: Optional[List[AbstractAnalysis]] = None,
      viz_facets: Optional[List[AbstractVisualization]] = None,
      return_state: bool = False,
      verbosity: int = 2,
      **kwargs,
  ) -> Optional[AnalysisState]:
      """
      This helper creates `BaseAnalysis` wrapping passed analyses into
      `Sampler` if needed, then fits and renders produced state with
      specified visualizations.
  
      Parameters
      ----------
      train_data
          training dataset
      test_data
          test dataset
      val_data
          validation dataset
      model
          trained `Predictor`
      label: str
          target variable
      state: Union[None, dict, AnalysisState], default = None
          pass prior state if necessary; the object will be updated during `anlz_facets` `fit` call.
      sample: Union[None, int, float], default = 10000
          sample size; if `int`, then row number is used;
          `float` must be between 0.0 and 1.0 and represents fraction of dataset to sample;
          `None` means no sampling
          See also :func:`autogluon.eda.analysis.dataset.Sampler`
      anlz_facets: List[AbstractAnalysis]
          analyses to add to this composite analysis
      viz_facets: List[AbstractVisualization]
          visualizations to add to this composite analysis
      return_state: bool, default = False
          return state if `True`
      verbosity: int, default = 2,
          Verbosity levels range from 0 to 4 and control how much information is printed.
          Higher levels correspond to more detailed print statements (you can set verbosity = 0 to suppress warnings).
          If using logging, you can alternatively control amount of information printed via `logger.setLevel(L)`,
          where `L` ranges from 0 to 50 (Note: higher values of `L` correspond to fewer print statements, opposite of verbosity levels).
  
      Returns
      -------
      state after `fit` call if `return_state` is `True`; `None` otherwise
  
      Examples
      --------
      >>> import autogluon.eda.analysis as eda
      >>> import autogluon.eda.visualization as viz
      >>> import autogluon.eda.auto as auto
      >>> state = auto.analyze(
      >>>     train_data=..., label=..., return_state=True,
      >>>     anlz_facets=[
      >>>         # Add analysis chain here
      >>>     ],
      >>>     viz_facets=[
      >>>         # Add visualization facets here
      >>>     ]
      >>> )
  
      """
  
      if viz_facets is None:
          viz_facets = []
  
      if anlz_facets is None:
          anlz_facets = []
  
      if state is not None:
          assert isinstance(state, (dict, AnalysisState))
  
      if not isinstance(state, AnalysisState):
          state = AnalysisState(state)
  
      root_logger = logging.getLogger("autogluon")
      root_log_level = root_logger.level
      log_level = verbosity2loglevel(verbosity)
      root_logger.setLevel(log_level)
  
      analysis = BaseAnalysis(
          state=state,
          train_data=train_data,
          test_data=test_data,
          val_data=val_data,
          model=model,
          label=label,
          children=[
              Sampler(sample=sample, children=anlz_facets),
          ],
      )
  
      state = analysis.fit()
  
      SimpleVerticalLinearLayout(
          facets=viz_facets,
      ).render(state)
  
      root_logger.setLevel(root_log_level)  # Reset log level
  
      return state if return_state else None
  
imports: import logging
  from typing import Any, Dict, List, Optional, Tuple, Union
  import pandas
  from autogluon.common.utils.log_utils import verbosity2loglevel
  from autogluon.features import CategoryFeatureGenerator
  from autogluon.tabular import TabularPredictor
  from ..None import AnalysisState
  from ..analysis import AnomalyDetectorAnalysis, ApplyFeatureGenerator, AutoGluonModelEvaluator, AutoGluonModelQuickFit, Correlation, DistributionFit, FeatureInteraction, MissingValuesAnalysis, ProblemTypeControl, ShapAnalysis, TrainValidationSplit, XShiftDetector
  from ..analysis.base import AbstractAnalysis, BaseAnalysis, SaveArgsToState
  from ..analysis.dataset import DatasetSummary, LabelInsightsAnalysis, RawTypesAnalysis, Sampler, SpecialTypesAnalysis, VariableTypeAnalysis
  from ..analysis.interaction import FeatureDistanceAnalysis
  from ..state import is_key_present_in_state
  from ..utils.common import expand_nested_args_into_nested_maps, get_empty_dict_if_none
  from ..utils.defaults import QuickFitDefaults
  from ..visualization import AnomalyScoresVisualization, ConfusionMatrix, CorrelationVisualization, DatasetStatistics, DatasetTypeMismatch, ExplainForcePlot, ExplainWaterfallPlot, FeatureImportance, FeatureInteractionVisualization, LabelInsightsVisualization, MarkdownSectionComponent, MissingValues, ModelLeaderboard, PropertyRendererComponent, RegressionEvaluation, XShiftSummary
  from ..visualization.base import AbstractVisualization
  from ..visualization.interaction import FeatureDistanceAnalysisVisualization, PDPInteractions
  from ..visualization.layouts import SimpleVerticalLinearLayout
label_desc: Use image node_id 1 for calling a global function with example usage: analyze(train_data, test_data, val_data, model, label, state, sample, anlz_facets, viz_facets, return_state, verbosity) and returns: unknown