code: def test_raises_on_bad_index(some_fig):
      # Check indexing errors can be detected when path used as key to go.Figure
      raised = False
      try:
          x0 = some_fig["layout.shapes[2].x0"]
      except KeyError as e:
          raised = True
          assert (
              e.args[0].find(
                  """Bad property path:
  layout.shapes[2].x0
                ^"""
              )
              >= 0
          )
      assert raised
  
imports: import plotly.graph_objects
  from _plotly_utils.exceptions import PlotlyKeyError
  import pytest
label_desc: Use image node_id 3 for calling a global function with example usage: test_raises_on_bad_index(some_fig) without return types