code: def test_conserve_memory(self):
      model = self.model
  
      # Clear the filter method
      model.conserve_memory = MEMORY_STORE_ALL
  
      # Try setting via boolean
      model.memory_no_forecast = True
      assert_equal(model.conserve_memory, MEMORY_NO_FORECAST)
      model.memory_no_filtered = True
      assert_equal(
          model.conserve_memory, MEMORY_NO_FORECAST | MEMORY_NO_FILTERED
      )
      model.memory_no_forecast = False
      assert_equal(model.conserve_memory, MEMORY_NO_FILTERED)
  
      # Try setting directly via method
      model.set_conserve_memory(MEMORY_NO_PREDICTED)
      assert_equal(model.conserve_memory, MEMORY_NO_PREDICTED)
  
      # Try setting via boolean via method
      model.set_conserve_memory(
          memory_no_filtered=True, memory_no_predicted=False
      )
      assert_equal(model.conserve_memory, MEMORY_NO_FILTERED)
  
      # Try setting and unsetting all
      model.conserve_memory = 0
      for name in model.memory_options:
          if name == "memory_conserve":
              continue
          setattr(model, name, True)
      assert_equal(
          model.conserve_memory,
          MEMORY_NO_FORECAST
          | MEMORY_NO_PREDICTED
          | MEMORY_NO_FILTERED
          | MEMORY_NO_LIKELIHOOD
          | MEMORY_NO_GAIN
          | MEMORY_NO_SMOOTHING
          | MEMORY_NO_STD_FORECAST,
      )
      assert_equal(
          model.conserve_memory & MEMORY_CONSERVE, MEMORY_CONSERVE
      )
      for name in model.memory_options:
          if name == "memory_conserve":
              continue
          setattr(model, name, False)
      assert_equal(model.conserve_memory, 0)
  
file_path: statsmodels/statsmodels/tsa/statespace/tests/test_options.py
imports: import numpy
  from statsmodels.tsa.statespace.kalman_filter import FILTER_CONVENTIONAL, FILTER_EXACT_INITIAL, FILTER_AUGMENTED, FILTER_SQUARE_ROOT, FILTER_UNIVARIATE, FILTER_COLLAPSED, FILTER_EXTENDED, FILTER_UNSCENTED, FILTER_CONCENTRATED, FILTER_CHANDRASEKHAR, INVERT_UNIVARIATE, SOLVE_LU, INVERT_LU, SOLVE_CHOLESKY, INVERT_CHOLESKY, STABILITY_FORCE_SYMMETRY, MEMORY_STORE_ALL, MEMORY_NO_FORECAST, MEMORY_NO_PREDICTED, MEMORY_NO_FILTERED, MEMORY_NO_LIKELIHOOD, MEMORY_NO_GAIN, MEMORY_NO_SMOOTHING, MEMORY_NO_STD_FORECAST, MEMORY_CONSERVE
  from statsmodels.tsa.statespace.kalman_smoother import SMOOTHER_STATE, SMOOTHER_STATE_COV, SMOOTHER_STATE_AUTOCOV, SMOOTHER_DISTURBANCE, SMOOTHER_DISTURBANCE_COV, SMOOTHER_ALL
  from statsmodels.tsa.statespace.simulation_smoother import SimulationSmoother, SIMULATION_STATE, SIMULATION_ALL
  from numpy.testing import assert_equal
label_desc: Use image node_id 4 for calling the TestOptions obj's underlying member method code with example usage: obj.test_conserve_memory() without return types