code: def test_pipeline_insert(dummy_data):
      def mean(x):
          return x.rolling("5min").mean()
  
      def sum(x):
          return x.rolling("5min").sum()
  
      sp_mean = SeriesProcessor(mean, series_names=["TMP"])
      sp_sum = SeriesProcessor(sum, series_names=["TMP"])
  
      sps = [
          sp_sum,
          sp_sum,
          sp_mean,
          sp_sum,
          sp_sum,
          sp_mean,
          sp_mean,
          sp_sum,
          sp_mean,
      ]
  
      # create the base pipeline
      pipe_a = SeriesPipeline(processors=[sps[0]])
      pipe_a.insert(0, sps[1:2][0])  # note, this is a single item
      with pytest.raises(TypeError):
          # we do not allow inserting lists, must be a single item
          pipe_a.insert(0, sps[2:4])
  
      pipe_b = SeriesPipeline(processors=sps[2:])
      pipe_a.insert(1, pipe_b)
      p_steps = pipe_a.processing_steps
      assert p_steps[0].name == sps[0].name
      for i, ps in enumerate(p_steps[1:-1]):
          assert ps.name == sps[i + 2].name
      assert p_steps[-1].name == sps[1].name
  
file_path: tsflex/tests/test_processing_series_pipeline.py
imports: import os
  from pathlib import Path
  import dill
  import numpy
  import pandas
  import pytest
  from tsflex.processing import SeriesPipeline, SeriesProcessor, dataframe_func
  from tsflex.processing.series_pipeline import _ProcessingError
  from .utils import dummy_data
label_desc: Use image node_id 4 for calling a global function with example usage: test_pipeline_insert(dummy_data) and returns: x, x