code: def test_split_impute():
      def check_split(
          df_in, df_len_expected, n_lags, n_forecasts, freq, p=0.1
      ):
          m = NeuralProphet(
              epochs=EPOCHS,
              batch_size=BATCH_SIZE,
              learning_rate=LR,
              n_lags=n_lags,
              n_forecasts=n_forecasts,
          )
          df_in, _, _ = df_utils.check_dataframe(df_in, check_y=False)
          df_in = _handle_missing_data(
              df=df_in,
              freq=freq,
              n_lags=n_lags,
              n_forecasts=n_forecasts,
              config_missing=m.config_missing,
              config_regressors=m.config_regressors,
              config_lagged_regressors=m.config_lagged_regressors,
              config_events=m.config_events,
              config_seasonality=m.config_seasonality,
              predicting=False,
          )
          assert df_len_expected == len(df_in)
          total_samples = len(df_in) - n_lags - 2 * n_forecasts + 2
          df_train, df_test = m.split_df(df_in, freq=freq, valid_p=0.1)
          n_train = len(df_train) - n_lags - n_forecasts + 1
          n_test = len(df_test) - n_lags - n_forecasts + 1
          assert total_samples == n_train + n_test
          n_test_expected = max(1, int(total_samples * p))
          n_train_expected = total_samples - n_test_expected
          assert n_train == n_train_expected
          assert n_test == n_test_expected
  
      log.info("testing: SPLIT: daily data")
      df = pd.read_csv(PEYTON_FILE)
      check_split(
          df_in=df,
          df_len_expected=len(df) + 59,
          freq="D",
          n_lags=10,
          n_forecasts=3,
      )
      log.info("testing: SPLIT: monthly data")
      df = pd.read_csv(AIR_FILE, nrows=NROWS)
      check_split(
          df_in=df,
          df_len_expected=len(df),
          freq="MS",
          n_lags=10,
          n_forecasts=3,
      )
      log.info("testing: SPLIT:  5min data")
      df = pd.read_csv(YOS_FILE, nrows=NROWS)
      check_split(
          df_in=df,
          df_len_expected=len(df),
          freq="5min",
          n_lags=10,
          n_forecasts=3,
      )
      # redo with no lags
      log.info("testing: SPLIT: daily data")
      df = pd.read_csv(PEYTON_FILE, nrows=NROWS)
      check_split(
          df_in=df,
          df_len_expected=len(df),
          freq="D",
          n_lags=0,
          n_forecasts=1,
      )
      log.info("testing: SPLIT: monthly data")
      df = pd.read_csv(AIR_FILE, nrows=NROWS)
      check_split(
          df_in=df,
          df_len_expected=len(df),
          freq="MS",
          n_lags=0,
          n_forecasts=1,
      )
      log.info("testing: SPLIT:  5min data")
      df = pd.read_csv(YOS_FILE)
      check_split(
          df_in=df,
          df_len_expected=len(df) - 12,
          freq="5min",
          n_lags=0,
          n_forecasts=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 6 for calling a global function with example usage: test_split_impute() without return types