code: def test_newer_sample_weight():
      dates = pd.date_range(start="2020-01-01", periods=100, freq="D")
      a = [0, 1] * 50
      y = -1 * np.array(a[:50])
      y = np.concatenate([y, np.array(a[50:])])
      # first half: y = -a
      # second half: y = a
      df = pd.DataFrame({"ds": dates, "y": y, "a": a})
  
      newer_bias = 5
      m = NeuralProphet(
          epochs=10,
          batch_size=10,
          learning_rate=LR,
          newer_samples_weight=newer_bias,
          newer_samples_start=0.0,
          # growth='off',
          n_changepoints=0,
          daily_seasonality=False,
          weekly_seasonality=False,
          yearly_seasonality=False,
      )
      m.add_future_regressor("a")
      m.fit(df)
  
      # test that second half dominates
      # -> positive relationship of a and y
      dates = pd.date_range(start="2020-01-01", periods=100, freq="D")
      a = [1] * 100
      y = [0] * 100
      df = pd.DataFrame({"ds": dates, "y": y, "a": a})
      forecast1 = m.predict(df[:10])
      forecast2 = m.predict(df[-10:])
      avg_a1 = np.mean(forecast1["future_regressor_a"])
      avg_a2 = np.mean(forecast2["future_regressor_a"])
      log.info(f"avg regressor a contribution first samples: {avg_a1}")
      log.info(f"avg regressor a contribution last samples: {avg_a2}")
      # must hold
      assert avg_a1 > 0.1
      assert avg_a2 > 0.1
  
      # this is less strict, as it also depends on trend, but should still hold
      avg_y1 = np.mean(forecast1["yhat1"])
      avg_y2 = np.mean(forecast2["yhat1"])
      log.info(f"avg yhat first samples: {avg_y1}")
      log.info(f"avg yhat last samples: {avg_y2}")
      assert avg_y1 > -0.9
      assert avg_y2 > 0.1
  
imports: import logging
  import os
  import pathlib
  import matplotlib.pyplot
  import numpy
  import pandas
  import pytest
  from torch.utils.data import DataLoader
  from neuralprophet import NeuralProphet, configure, df_utils, time_dataset
  from neuralprophet.data.process import _create_dataset, _handle_missing_data
  from neuralprophet.data.transform import _normalize
label_desc: Use image node_id 15 for calling a global function with example usage: test_newer_sample_weight() without return types