code: def test_to_ordered_dict(self):
      fig = go.Figure(
          layout={
              "yaxis": {"range": [1, 2]},
              "xaxis": {"range": [1, 2]},
              "shapes": [
                  {"xsizemode": "pixel", "type": "circle"},
                  {"type": "line", "xsizemode": "pixel"},
              ],
          },
          data=[
              {
                  "type": "scatter",
                  "marker": {"size": 12, "color": "green"},
              },
              {"type": "bar", "y": [1, 2], "x": [1, 2]},
          ],
      )
  
      result = fig.to_ordered_dict()
  
      expected = OrderedDict(
          [
              (
                  "data",
                  [
                      OrderedDict(
                          [
                              (
                                  "marker",
                                  OrderedDict(
                                      [("color", "green"), ("size", 12)]
                                  ),
                              ),
                              ("type", "scatter"),
                          ]
                      ),
                      OrderedDict(
                          [
                              ("type", "bar"),
                              ("x", [1, 2]),
                              ("y", [1, 2]),
                          ]
                      ),
                  ],
              ),
              (
                  "layout",
                  OrderedDict(
                      [
                          (
                              "shapes",
                              [
                                  OrderedDict(
                                      [
                                          ("type", "circle"),
                                          ("xsizemode", "pixel"),
                                      ]
                                  ),
                                  OrderedDict(
                                      [
                                          ("type", "line"),
                                          ("xsizemode", "pixel"),
                                      ]
                                  ),
                              ],
                          ),
                          ("xaxis", OrderedDict([("range", [1, 2])])),
                          ("yaxis", OrderedDict([("range", [1, 2])])),
                      ]
                  ),
              ),
          ]
      )
  
      self.assertEqual(result, expected)
  
imports: import plotly.graph_objs
  from collections import OrderedDict
  from plotly.tests.utils import TestCaseNoTemplate
label_desc: Use image node_id 1 for calling the FigureTest obj's underlying member method code with example usage: obj.test_to_ordered_dict() without return types