code: def test_leading_underscore_errors(some_fig):
      # get error string but alter it to form the final expected string
      def _raise_bad_property_path_form():
          some_fig.update_layout(bogus=7)
  
      def _raise_bad_property_path_real():
          some_fig.update_layout(_hey_yall=7)
  
      correct_err_str = form_error_string(
          _raise_bad_property_path_form,
          ValueError,
          # change last boxgap to geo because bogus is closest to boxgap but _hey
          # closest to geo, but remember that boxgap is in the list of valid keys
          # displayed by the error string
          [
              ("bogus", "_hey"),
              ("bogus", "_hey_yall"),
              ("^^^^^", "^^^^"),
              ('Did you mean "boxgap"', 'Did you mean "geo"'),
              ('Did you mean "boxgap"', 'Did you mean "geo"'),
          ],
      )
      check_error_string(
          _raise_bad_property_path_real, ValueError, correct_err_str, []
      )
  
imports: import plotly.graph_objects
  from _plotly_utils.exceptions import PlotlyKeyError
  import pytest
label_desc: Use image node_id 12 for calling a global function with example usage: test_leading_underscore_errors(some_fig) without return types