code: def register_plotly_resampler(mode="auto", **aggregator_kwargs):
      """Register plotly-resampler to plotly.graph_objects.
  
      This function results in the use of plotly-resampler under the hood.
  
      !!! note
          We advise to use mode= ``widget`` when working in an IPython based environment
          as this will just behave as a ``go.FigureWidget``, but with dynamic aggregation.
          When using mode= ``auto`` or ``figure``; most figures will be wrapped as
          [`FigureResampler`][figure_resampler.FigureResampler], on which
          [`show_dash`][figure_resampler.FigureResampler.show_dash] needs to be called.
  
      !!! note
          This function is mostly useful for notebooks. For dash-apps, we advise to look
          at the dash app examples on [GitHub](https://github.com/predict-idlab/plotly-resampler/tree/main/examples#2-dash-apps)
  
      Parameters
      ----------
      mode : str, optional
          The mode of the plotly-resampler.
          Possible values are: 'auto', 'figure', 'widget', None.
          If 'auto' is used, the mode is determined based on the environment; if it is in
          an IPython environment, the mode is 'widget', otherwise it is 'figure'.
          If 'figure' is used, all plotly figures are wrapped as FigureResampler objects.
          If 'widget' is used, all plotly figure widgets are wrapped as
          FigureWidgetResampler objects (we advise to use this mode in IPython environment
          with a kernel).
          If None is used, wrapping is done as expected (go.Figure -> FigureResampler,
          go.FigureWidget -> FigureWidgetResampler).
      aggregator_kwargs : dict, optional
          The keyword arguments to pass to the plotly-resampler decorator its constructor.
          See more details in [`FigureResampler`][figure_resampler.FigureResampler] and
          [`FigureWidgetResampler`][figure_resampler.FigureWidgetResampler].
  
      """
      for constr_name, pr_class in PLOTLY_CONSTRUCTOR_WRAPPER.items():
          if (mode == "auto" and _is_ipython_env()) or mode == "widget":
              pr_class = FigureWidgetResampler
          elif mode == "figure":
              pr_class = FigureResampler
          # else: default mode -> wrap according to PLOTLY_CONSTRUCTOR_WRAPPER
  
          for module in PLOTLY_MODULES:
              _register_wrapper(
                  module, constr_name, pr_class, **aggregator_kwargs
              )
  
file_path: plotly-resampler/plotly_resampler/registering.py
imports: from functools import wraps
  import plotly
  from plotly_resampler import FigureResampler, FigureWidgetResampler
  from plotly_resampler.figure_resampler.figure_resampler_interface import AbstractFigureAggregator
label_desc: Use image node_id 5 for calling a global function with example usage: register_plotly_resampler(mode) without return types