code: def test_with_evc_tree(monkeypatch, kind):
      """Tests that the plotly backend returns a plotly object"""
  
      WITH_EVC_TREE = True
  
      original_to_pandas = Experiment.to_pandas
  
      def mock_to_pandas(self, with_evc_tree):
          assert with_evc_tree is WITH_EVC_TREE
          return original_to_pandas(self, with_evc_tree)
  
      monkeypatch.setattr(
          "orion.core.worker.experiment.Experiment.to_pandas",
          mock_to_pandas,
      )
  
      with create_experiment(config, trial_config, ["completed"]) as (
          _,
          _,
          experiment,
      ):
          pa = PlotAccessor(experiment)
  
          WITH_EVC_TREE = True
          plot = getattr(pa, kind)(with_evc_tree=WITH_EVC_TREE)
          check_plot(plot, kind)
  
          WITH_EVC_TREE = False
          plot = getattr(pa, kind)(with_evc_tree=WITH_EVC_TREE)
          check_plot(plot, kind)
  
file_path: orion/tests/unittests/plotting/test_plot_accessor.py
imports: import pytest
  from orion.core.worker.experiment import Experiment
  from orion.plotting.base import PlotAccessor
  from orion.testing import create_experiment
label_desc: Use image node_id 8 for calling a global function with example usage: test_with_evc_tree(monkeypatch, kind) and returns: original_to_pandas