code: def test_online_updates(self):
      print("-" * 80)
      logger.info("test_online_updates\n" + "-" * 80 + "\n")
  
      # create fixed period corresponding to last 9 days
      scope = "9d"
      tf = to_pd_datetime(self.vals_train.tf)
      fixed_period = tuple(
          str(t) for t in (tf - pd.Timedelta(scope), tf)
      )
  
      kwargs = dict(wind_sz="27min", trends=["daily", "weekly"])
      rolling_config = DynamicBaselineConfig(
          train_window=scope, **kwargs
      )
      fixed_config = DynamicBaselineConfig(
          fixed_period=fixed_period, **kwargs
      )
  
      rolling_model, rolling_imodel = DynamicBaseline(
          rolling_config
      ), DynamicBaseline(rolling_config)
      fixed_model, fixed_imodel = DynamicBaseline(
          fixed_config
      ), DynamicBaseline(fixed_config)
  
      for model, imodel in (
          (fixed_model, fixed_imodel),
          (rolling_model, rolling_imodel),
      ):
          # train model
          model.train(self.vals_train)
          # train & update model incrementally
          imodel.train(self.vals_train[:-121])
          imodel.update(self.vals_train[-125:-74])
          imodel.update(self.vals_train[-74:])
          # score
          scores, iscores = [
              m.get_anomaly_score(self.vals_test)
              for m in (model, imodel)
          ]
          score_diffs = (
              scores.squeeze().np_values - iscores.squeeze().np_values
          )
          self.assertAlmostEqual(
              np.abs(score_diffs).max(), 0, delta=1e-3
          )
  
      # test rolling model against fixed model
      fixed_scores = fixed_model.get_anomaly_score(self.vals_test)
      rolling_scores = rolling_model.get_anomaly_score(self.vals_test)
      self.assertEqual(fixed_scores, rolling_scores)
  
imports: from functools import reduce
  import logging
  import os
  from os.path import abspath, dirname, join
  import sys
  import unittest
  import numpy
  import pandas
  from merlion.models.anomaly.dbl import DynamicBaseline, DynamicBaselineConfig, Trend
  from merlion.utils.ts_generator import GeneratorConcatenator, TimeSeriesGenerator
  from merlion.utils.resample import to_pd_datetime
label_desc: Use image node_id 5 for calling the TestDynamicBaseline obj's underlying member method code with example usage: obj.test_online_updates() without return types