code: def _compare_figures(go_trace, px_fig):
      """Compare a figure created with a go trace and a figure created with
      a px function call. Check that all values inside the go Figure are the
      same in the px figure (which sets more parameters).
      """
      go_fig = go.Figure(go_trace)
      go_fig = go_fig.to_plotly_json()
      px_fig = px_fig.to_plotly_json()
      del go_fig["layout"]["template"]
      del px_fig["layout"]["template"]
      for key in go_fig["data"][0]:
          assert_array_equal(
              go_fig["data"][0][key], px_fig["data"][0][key]
          )
      for key in go_fig["layout"]:
          assert go_fig["layout"][key] == px_fig["layout"][key]
  
file_path: plotly.py/packages/python/plotly/plotly/tests/test_optional/test_px/test_px_functions.py
imports: import plotly.express
  import plotly.graph_objects
  from numpy.testing import assert_array_equal
  import numpy
  import pandas
  import pytest
label_desc: Use image node_id 1 for calling a global function with example usage: _compare_figures(go_trace, px_fig) without return types