code: def test_update_layout_overwrite(self):
      fig = go.Figure(
          layout=go.Layout(
              annotations=[
                  go.layout.Annotation(text="one"),
                  go.layout.Annotation(text="two"),
              ]
          )
      )
  
      fig.update_layout(
          overwrite=True,
          annotations=[
              go.layout.Annotation(width=10),
              go.layout.Annotation(width=20),
              go.layout.Annotation(width=30),
              go.layout.Annotation(width=40),
              go.layout.Annotation(width=50),
          ],
      )
  
      expected = {
          "annotations": [
              {"width": 10},
              {"width": 20},
              {"width": 30},
              {"width": 40},
              {"width": 50},
          ]
      }
  
      fig.layout.pop("template")
      self.assertEqual(fig.layout.to_plotly_json(), expected)
  
      # Remove all annotations
      fig.update_layout(overwrite=True, annotations=None)
      self.assertEqual(fig.layout.annotations, ())
  
file_path: plotly.py/packages/python/plotly/plotly/tests/test_core/test_update_objects/test_update_layout.py
imports: from unittest import TestCase
  import plotly.graph_objects
label_desc: Use image node_id 4 for calling the TestUpdateLayout obj's underlying member method code with example usage: obj.test_update_layout_overwrite() without return types