code: def test_min_max_lag_order():
      """Testing max_lag_order for various cases."""
      # case with no lags
      agg_lag_dict = {"orders_list": [], "interval_list": []}
      lag_dict = {"orders": None, "max_order": None}
  
      min_max_order = min_max_lag_order(
          lag_dict=lag_dict, agg_lag_dict=agg_lag_dict
      )
      min_order = min_max_order["min_order"]
      max_order = min_max_order["max_order"]
  
      assert max_order == 0, "max_order is not calculated correctly"
  
      assert (
          min_order == np.inf
      ), "min_order is not calculated correctly"
  
      # case with lag_dict only including lags
      agg_lag_dict = {"orders_list": [], "interval_list": []}
      lag_dict = {"orders": [2, 3, 13], "max_order": None}
  
      min_max_order = min_max_lag_order(
          lag_dict=lag_dict, agg_lag_dict=agg_lag_dict
      )
      min_order = min_max_order["min_order"]
      max_order = min_max_order["max_order"]
  
      assert max_order == 13, "max_order is not calculated correctly"
      assert min_order == 2, "max_order is not calculated correctly"
  
      # `max_order` below is expected to be ignored
      # since `orders` is provided
      lag_dict = {"orders": [2, 3, 13], "max_order": 20}
      agg_lag_dict = None
  
      min_max_order = min_max_lag_order(
          lag_dict=lag_dict, agg_lag_dict=agg_lag_dict
      )
      min_order = min_max_order["min_order"]
      max_order = min_max_order["max_order"]
  
      assert max_order == 13, "max_order is not calculated correctly"
      assert min_order == 2, "max_order is not calculated correctly"
  
      # case with agg_lag_dict inclduing lags only
      agg_lag_dict = {
          "orders_list": [[1, 2, 3, 16]],
          "interval_list": [[1, 2]],
      }
      lag_dict = {"orders": None, "max_order": None}
  
      min_max_order = min_max_lag_order(
          lag_dict=lag_dict, agg_lag_dict=agg_lag_dict
      )
      min_order = min_max_order["min_order"]
      max_order = min_max_order["max_order"]
  
      assert max_order == 16, "max_order is not calculated correctly"
      assert min_order == 1, "max_order is not calculated correctly"
  
      # case with both agg_lag_dict and lag_dict prescribing lags
      agg_lag_dict = {
          "orders_list": [[1, 2, 3]],
          "interval_list": [(2, 3), (2, 5)],
      }
      lag_dict = {"orders": [2, 3, 8], "max_order": None}
  
      min_max_order = min_max_lag_order(
          lag_dict=lag_dict, agg_lag_dict=agg_lag_dict
      )
      min_order = min_max_order["min_order"]
      max_order = min_max_order["max_order"]
  
      assert max_order == 8, "max_order is not calculated correctly"
  
      assert min_order == 1, "min_order is not calculated correctly"
  
      # case with max_order appearing in lag_dict["max_order"]
      agg_lag_dict = {
          "orders_list": [[2, 3]],
          "interval_list": [(3, 6), (3, 10)],
      }
      lag_dict = {"orders": None, "max_order": 18}
  
      min_max_order = min_max_lag_order(
          lag_dict=lag_dict, agg_lag_dict=agg_lag_dict
      )
      min_order = min_max_order["min_order"]
      max_order = min_max_order["max_order"]
  
      assert max_order == 18, "max_order is not calculated correctly"
  
      assert min_order == 1, "min_order is not calculated correctly"
  
imports: import numpy
  import pandas
  import pytest
  from greykite.common.features.timeseries_lags import build_agg_lag_df
  from greykite.common.features.timeseries_lags import build_autoreg_df
  from greykite.common.features.timeseries_lags import build_autoreg_df_multi
  from greykite.common.features.timeseries_lags import build_lag_df
  from greykite.common.features.timeseries_lags import min_max_lag_order
  from greykite.common.python_utils import assert_equal
label_desc: Use image node_id 4 for calling a global function with example usage: test_min_max_lag_order() without return types