code: def test_scale(monkeypatch, single_with_trials):
      """Test that scale is passed properly"""
  
      SCALE = random.uniform(0, 3)
  
      def check_args(self, output, scale, **kwargs):
          assert scale == SCALE
  
      monkeypatch.setattr(
          "plotly.graph_objs._figure.Figure.write_image", check_args
      )
  
      returncode = orion.core.cli.main(
          [
              "plot",
              "regret",
              "--name",
              "test_single_exp",
              "--scale",
              str(SCALE),
          ]
      )
      assert returncode == 0
  
imports: import random
  import pytest
  import orion.core.cli
  import orion.plotting.backend_plotly
  from orion.core.cli.plot import IMAGE_TYPES, VALID_TYPES
  from orion.plotting.base import SINGLE_EXPERIMENT_PLOTS
  from orion.storage.base import setup_storage
  from orion.testing import AssertNewFile
label_desc: Use image node_id 12 for calling a global function with example usage: test_scale(monkeypatch, single_with_trials) without return types