code: def test_get_changes_from_beta():
      beta = np.array([1, 2, 3, 2, 3, 4, 3, 4, 5, 4, 5, 6])
      seasonality_components_df = pd.DataFrame(
          {
              "name": ["tow", "conti_year"],
              "period": [7.0, 1.0],
              "order": [1, 2],
              "seas_names": ["weekly", "yearly"],
          }
      )
      # tests changes with L2 norm on cusum values
      expected_components = ["weekly", "yearly"]
      expected_changes = [
          np.array([np.sqrt(5), np.sqrt(52) - np.sqrt(5)]),
          np.array([np.sqrt(38), np.sqrt(264) - np.sqrt(38)]),
      ]
      result = get_changes_from_beta(
          beta, seasonality_components_df, True
      )  # with cusum
      components = list(result.keys())
      changes = list(result.values())
      assert components == expected_components
      assert all(
          all(changes[i] == expected_changes[i])
          for i in range(len(changes))
      )
      # tests changes with L2 norm on change coefficients
      expected_changes = [
          np.array([np.sqrt(5), 5]),
          np.array([np.sqrt(38), np.sqrt(102)]),
      ]
      result = get_changes_from_beta(
          beta, seasonality_components_df, False
      )  # without cusum
      components = list(result.keys())
      changes = list(result.values())
      assert components == expected_components
      assert all(
          all(changes[i] == expected_changes[i])
          for i in range(len(changes))
      )
  
imports: from datetime import datetime
  import numpy
  import pandas
  import pytest
  from greykite.algo.changepoint.adalasso.changepoints_utils import adaptive_lasso_cv
  from greykite.algo.changepoint.adalasso.changepoints_utils import build_seasonality_feature_df_from_detection_result
  from greykite.algo.changepoint.adalasso.changepoints_utils import build_seasonality_feature_df_with_changes
  from greykite.algo.changepoint.adalasso.changepoints_utils import build_trend_feature_df_with_changes
  from greykite.algo.changepoint.adalasso.changepoints_utils import check_freq_unit_at_most_day
  from greykite.algo.changepoint.adalasso.changepoints_utils import combine_detected_and_custom_trend_changepoints
  from greykite.algo.changepoint.adalasso.changepoints_utils import compute_fitted_components
  from greykite.algo.changepoint.adalasso.changepoints_utils import compute_min_changepoint_index_distance
  from greykite.algo.changepoint.adalasso.changepoints_utils import estimate_seasonality_with_detected_changepoints
  from greykite.algo.changepoint.adalasso.changepoints_utils import estimate_trend_with_detected_changepoints
  from greykite.algo.changepoint.adalasso.changepoints_utils import filter_changepoints
  from greykite.algo.changepoint.adalasso.changepoints_utils import find_neighbor_changepoints
  from greykite.algo.changepoint.adalasso.changepoints_utils import get_changes_from_beta
  from greykite.algo.changepoint.adalasso.changepoints_utils import get_seasonality_changepoint_df_cols
  from greykite.algo.changepoint.adalasso.changepoints_utils import get_seasonality_changes_from_adaptive_lasso
  from greykite.algo.changepoint.adalasso.changepoints_utils import get_trend_changepoint_dates_from_cols
  from greykite.algo.changepoint.adalasso.changepoints_utils import get_trend_changes_from_adaptive_lasso
  from greykite.algo.changepoint.adalasso.changepoints_utils import get_yearly_seasonality_changepoint_dates_from_freq
  from greykite.algo.changepoint.adalasso.changepoints_utils import plot_change
  from greykite.common.testing_utils import generate_df_for_tests
label_desc: Use image node_id 13 for calling a global function with example usage: test_get_changes_from_beta() without return types