code: def render_time_series(
      results: view_types.EvalResults,
      slicing_spec: Optional[
          Union[slicer.SingleSliceSpec, config_pb2.SlicingSpec]
      ] = None,
      display_full_path: bool = False,
  ) -> Optional[
      visualization.TimeSeriesViewer
  ]:  # pytype: disable=invalid-annotation
      """Renders the time series view as widget.
  
      Args:
        results: An tfma.EvalResults.
        slicing_spec: A tfma.SlicingSpec determining the slice to show time series
          on. Show overall if not set.
        display_full_path: Whether to display the full path to model / data in the
          visualization or just show file name.
  
      Returns:
        A TimeSeriesViewer object if in Jupyter notebook; None if in Colab.
      """
      if slicing_spec and isinstance(
          slicing_spec, config_pb2.SlicingSpec
      ):
          slicing_spec = slicer.SingleSliceSpec(spec=slicing_spec)
      slice_spec_to_use = (
          slicing_spec if slicing_spec else slicer.SingleSliceSpec()
      )
      data = util.get_time_series(
          results, slice_spec_to_use, display_full_path
      )
      cfg = {
          "isModelCentric": results.get_mode()
          == constants.MODEL_CENTRIC_MODE
      }
  
      return visualization.render_time_series(data, cfg)
  
file_path: model-analysis/tensorflow_model_analysis/view/widget_view.py
imports: from typing import Callable, Dict, Optional, Union
  from tensorflow_model_analysis import constants
  import tensorflow_model_analysis.notebook.visualization
  from tensorflow_model_analysis.proto import config_pb2
  from tensorflow_model_analysis.slicer import slicer_lib
  from tensorflow_model_analysis.view import util
  from tensorflow_model_analysis.view import view_types
label_desc: Use image node_id 2 for calling a global function with example usage: render_time_series(results, slicing_spec, display_full_path) and returns: visualization