code: def _plot_to_url_or_load_cached_url(
      *args: Any, **kwargs: Any
  ) -> "go.Figure":
      """Call plotly.plot wrapped in st.cache.
  
      This is so we don't unnecessarily upload data to Plotly's SASS if nothing
      changed since the previous upload.
      """
      try:
          # Plotly 4 changed its main package.
          import chart_studio.plotly as ply
      except ImportError:
          import plotly.plotly as ply
  
      return ply.plot(*args, **kwargs)
  
file_path: streamlit/lib/streamlit/elements/plotly_chart.py
imports: import json
  import urllib.parse
  from typing import TYPE_CHECKING, Any, Dict, List, Set, Union, cast
  from typing_extensions import Final, Literal, TypeAlias
  from streamlit import type_util
  from streamlit.errors import StreamlitAPIException
  from streamlit.logger import get_logger
  from streamlit.proto.PlotlyChart_pb2 import PlotlyChart
  from streamlit.runtime.legacy_caching import caching
  from streamlit.runtime.metrics_util import gather_metrics
label_desc: Use image node_id 2 for calling a global function with example usage: _plot_to_url_or_load_cached_url() and returns: ply