code: def test_subscript_error_exception_types(some_fig):
      # Assert that these raise the expected error types
      # when width is None
      with pytest.raises(ValueError):
          some_fig.update_layout(width_yo=100)
      with pytest.raises(KeyError):
          yo = some_fig["layout_width_yo"]
  
      some_fig.update_layout(width=100)
      # when width is specified
      with pytest.raises(ValueError):
          some_fig.update_layout(width_yo=100)
      with pytest.raises(KeyError):
          yo = some_fig["layout_width_yo"]
  
imports: import plotly.graph_objects
  from _plotly_utils.exceptions import PlotlyKeyError
  import pytest
label_desc: Use image node_id 9 for calling a global function with example usage: test_subscript_error_exception_types(some_fig) without return types