code: def test_ordered_dict():
      """Tests pickling and unpickling of ordered dictionaries."""
      # Checks simple ordered dictionaries that can be serialized by dill.
      obj = OrderedDict({"a": 1, X(2): 3, 5: ["b"]})
      serialized_by_dill = GreykitePickler.dumps_to_str(obj)
      pickler = GreykitePickler()
      serialized = pickler.dumps(obj)
      assert serialized == {"ROOT.pkl": serialized_by_dill}
      deserialized = pickler.loads(serialized)
      assert isinstance(deserialized, OrderedDict)
      assert deserialized["a"] == obj["a"]
      assert deserialized[5] == obj[5]
  
      # Checks complex ordered dictionaries that cannot be serialized by dill.
      obj = OrderedDict({"a": 1, Term([]): 3, 5: ["b"]})
      with pytest.raises(NotImplementedError):
          dill.dumps(obj)
      pickler = GreykitePickler()
      serialized = pickler.dumps(obj)
      deserialized = pickler.loads(serialized)
      assert isinstance(deserialized, dict)
      assert deserialized["a"] == obj["a"]
      assert deserialized[5] == obj[5]
  
imports: import datetime
  import inspect
  import sys
  from collections import OrderedDict
  import dill
  import numpy
  import pandas
  import pytest
  from patsy.desc import Term
  from greykite.common.constants import ACTUAL_COL
  from greykite.common.constants import ANOMALY_COL
  from greykite.common.constants import PREDICTED_ANOMALY_COL
  from greykite.common.constants import PREDICTED_COL
  from greykite.common.constants import PREDICTED_LOWER_COL
  from greykite.common.constants import PREDICTED_UPPER_COL
  from greykite.common.constants import TIME_COL
  from greykite.common.constants import VALUE_COL
  from greykite.common.python_utils import assert_equal
  from greykite.common.testing_utils import generate_df_for_tests
  from greykite.common.testing_utils_anomalies import contaminate_df_with_anomalies
  from greykite.common.viz.timeseries_annotate import plot_anomalies_over_forecast_vs_actual
  from greykite.detection.common.ad_evaluation import f1_score
  from greykite.detection.common.ad_evaluation import precision_score
  from greykite.detection.common.ad_evaluation import recall_score
  from greykite.detection.common.pickler import GreykitePickler
  from greykite.detection.detector.ad_utils import partial_return
  from greykite.detection.detector.config import ADConfig
  from greykite.detection.detector.constants import FIG_SHOW
  from greykite.detection.detector.data import DetectorData
  from greykite.detection.detector.greykite import DETECTOR_PREDICT_COLS
  from greykite.detection.detector.greykite import GreykiteDetector
  from greykite.detection.detector.reward import Reward
  from greykite.framework.templates.autogen.forecast_config import ComputationParam
  from greykite.framework.templates.autogen.forecast_config import EvaluationPeriodParam
  from greykite.framework.templates.autogen.forecast_config import ForecastConfig
  from greykite.framework.templates.autogen.forecast_config import MetadataParam
  from greykite.framework.templates.autogen.forecast_config import ModelComponentsParam
  from greykite.framework.templates.forecaster import Forecaster
  from greykite.framework.templates.model_templates import ModelTemplateEnum
  from greykite.framework.utils.result_summary import summarize_grid_search_results
label_desc: Use image node_id 8 for calling a global function with example usage: test_ordered_dict() without return types