code: def test_extract_process_interval(self):
      plot_nodes = range(2)
      end_time = 12.0
      original_timestamps = [
          np.linspace(1.0, 6.0, 11),
          np.linspace(4.0, 10.0, 5),
      ]
      original_intensity_times = np.linspace(0, end_time, 13)
      original_intensities = [
          np.linspace(1.0, 2.2, 13),
          np.linspace(4.4, 2, 13),
      ]
  
      # t_min
      (
          timestamps,
          intensity_times,
          intensities,
      ) = _extract_process_interval(
          plot_nodes,
          end_time,
          original_timestamps,
          t_min=5,
          intensity_times=original_intensity_times,
          intensities=original_intensities,
      )
      self.assert_array_list_equal(
          timestamps,
          [np.array([5.0, 5.5, 6.0]), np.array([5.5, 7.0, 8.5, 10.0])],
      )
      np.testing.assert_array_equal(
          intensity_times, [5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0]
      )
  
      self.assert_array_list_equal(
          intensities,
          [
              np.array([1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2]),
              np.array([3.4, 3.2, 3.0, 2.8, 2.6, 2.4, 2.2, 2.0]),
          ],
      )
  
      # t_max
      (
          timestamps,
          intensity_times,
          intensity,
      ) = _extract_process_interval(
          plot_nodes, end_time, original_timestamps, t_max=9
      )
      self.assert_array_list_equal(
          timestamps,
          [
              np.array(
                  [
                      1.0,
                      1.5,
                      2.0,
                      2.5,
                      3.0,
                      3.5,
                      4.0,
                      4.5,
                      5.0,
                      5.5,
                      6.0,
                  ]
              ),
              np.array([4.0, 5.5, 7.0, 8.5]),
          ],
      )
  
      # t_min and t_max
      (
          timestamps,
          intensity_times,
          intensity,
      ) = _extract_process_interval(
          plot_nodes, end_time, original_timestamps, t_min=5, t_max=9
      )
      self.assert_array_list_equal(
          timestamps,
          [np.array([5.0, 5.5, 6.0]), np.array([5.5, 7.0, 8.5])],
      )
  
      # max_points = 0
      (
          timestamps,
          intensity_times,
          intensity,
      ) = _extract_process_interval(
          plot_nodes, end_time, original_timestamps, max_jumps=0
      )
      self.assert_array_list_equal(
          timestamps, [np.array([]), np.array([])]
      )
  
      # max_points
      (
          timestamps,
          intensity_times,
          intensity,
      ) = _extract_process_interval(
          plot_nodes, end_time, original_timestamps, max_jumps=2
      )
      self.assert_array_list_equal(
          timestamps, [np.array([1.0, 1.5]), np.array([])]
      )
  
      # max_points and t_min
      (
          timestamps,
          intensity_times,
          intensity,
      ) = _extract_process_interval(
          plot_nodes,
          end_time,
          original_timestamps,
          max_jumps=2,
          t_min=3.5,
      )
      self.assert_array_list_equal(
          timestamps, [np.array([3.5, 4.0]), np.array([4.0])]
      )
  
      # max_points and t_min too big
      (
          timestamps,
          intensity_times,
          intensity,
      ) = _extract_process_interval(
          plot_nodes,
          end_time,
          original_timestamps,
          max_jumps=10,
          t_min=3,
      )
      self.assert_array_list_equal(
          timestamps,
          [
              np.array([3.0, 3.5, 4.0, 4.5, 5.0, 5.5, 6.0]),
              np.array([4.0, 5.5, 7.0, 8.5, 10.0]),
          ],
      )
  
      # max_points and t_max
      (
          timestamps,
          intensity_times,
          intensity,
      ) = _extract_process_interval(
          plot_nodes,
          end_time,
          original_timestamps,
          max_jumps=4,
          t_max=8,
      )
      self.assert_array_list_equal(
          timestamps,
          [np.array([4.5, 5.0, 5.5, 6.0]), np.array([5.5, 7.0])],
      )
  
      # max_points and t_max too small
      (
          timestamps,
          intensity_times,
          intensity,
      ) = _extract_process_interval(
          plot_nodes,
          end_time,
          original_timestamps,
          max_jumps=4,
          t_max=2,
      )
      self.assert_array_list_equal(
          timestamps, [np.array([1.0, 1.5, 2.0]), np.array([])]
      )
  
      # max_points too big, t_min and t_max
      (
          timestamps,
          intensity_times,
          intensity,
      ) = _extract_process_interval(
          plot_nodes,
          end_time,
          original_timestamps,
          t_min=5,
          t_max=9,
          max_jumps=8,
      )
      self.assert_array_list_equal(
          timestamps,
          [np.array([5.0, 5.5, 6.0]), np.array([5.5, 7.0, 8.5])],
      )
  
      # max_points big, t_min and t_max too big
      (
          timestamps,
          intensity_times,
          intensity,
      ) = _extract_process_interval(
          plot_nodes,
          end_time,
          original_timestamps,
          t_min=4,
          t_max=9,
          max_jumps=3,
      )
      self.assert_array_list_equal(
          timestamps, [np.array([4.0, 4.5, 5.0]), np.array([4.0])]
      )
  
imports: import unittest
  import numpy
  from tick.plot.plot_point_processes import _extract_process_interval
label_desc: Use image node_id 2 for calling the Test obj's underlying member method code with example usage: obj.test_extract_process_interval() without return types