code: def test_regularization_events():
      log.info("testing: regularization of events")
      df, events = generate_event_dataset(
          y_events_override=Y_EVENTS_OVERRIDE
      )
      df, _, _ = df_utils.check_dataframe(df, check_y=False)
  
      m = NeuralProphet(
          epochs=50,
          batch_size=8,
          learning_rate=0.1,
          yearly_seasonality=False,
          weekly_seasonality=False,
          daily_seasonality=False,
          growth="off",
      )
      m = m.add_events(
          ["event_%i" % index for index, _ in enumerate(events)],
          regularization=REGULARIZATION,
      )
      events_df = pd.concat(
          [
              pd.DataFrame(
                  {
                      "event": "event_%i" % index,
                      "ds": pd.to_datetime([event]),
                  }
              )
              for index, event in enumerate(events)
          ]
      )
      history_df = m.create_df_with_events(df, events_df)
      m.fit(history_df, freq="D")
  
      to_reduce = []
      to_preserve = []
      for index, event in enumerate(events):
          weight_list = m.model.get_event_weights("event_%i" % index)
          for _, param in weight_list.items():
              if event in Y_EVENTS_OVERRIDE.keys():
                  to_reduce.append(param.detach().numpy()[0][0])
              else:
                  to_preserve.append(param.detach().numpy()[0][0])
      # print(to_reduce)
      # print(to_preserve)
      assert np.mean(to_reduce) < 0.1
      assert np.mean(to_preserve) > 0.5
  
file_path: neural_prophet/tests/test_regularization.py
imports: import logging
  import random
  import numpy
  import pandas
  import pytest
  import torch
  from neuralprophet import NeuralProphet, df_utils
  from neuralprophet.utils import reg_func_abs
  from tests.utils.dataset_generators import generate_event_dataset, generate_holiday_dataset, generate_lagged_regressor_dataset
label_desc: Use image node_id 3 for calling a global function with example usage: test_regularization_events() without return types