code: def test_stumpi_constant_subsequence_self_join_egress():
      m = 3
  
      seed = np.random.randint(100000)
      np.random.seed(seed)
  
      T = np.concatenate(
          (
              np.zeros(20, dtype=np.float64),
              np.ones(10, dtype=np.float64),
          )
      )
  
      ref_mp = naive.stumpi_egress(T, m)
      ref_P = ref_mp.P_.copy()
      # ref_I = ref_mp.I_
      ref_left_P = ref_mp.left_P_.copy()
      # ref_left_I = ref_mp.left_I_
  
      stream = stumpi(T, m, egress=True)
  
      comp_P = stream.P_.copy()
      # comp_I = stream.I_
      comp_left_P = stream.left_P_.copy()
      # comp_left_I = stream.left_I_
  
      naive.replace_inf(ref_P)
      naive.replace_inf(ref_left_P)
      naive.replace_inf(comp_P)
      naive.replace_inf(comp_left_P)
  
      npt.assert_almost_equal(ref_P, comp_P)
      # npt.assert_almost_equal(ref_I, comp_I)
      npt.assert_almost_equal(ref_left_P, comp_left_P)
      # npt.assert_almost_equal(ref_left_I, comp_left_I)
  
      for i in range(34):
          t = np.random.rand()
          ref_mp.update(t)
          stream.update(t)
  
          comp_P = stream.P_.copy()
          # comp_I = stream.I_
          comp_left_P = stream.left_P_.copy()
          # comp_left_I = stream.left_I_
  
          ref_P = ref_mp.P_.copy()
          # ref_I = ref_mp.I_
          ref_left_P = ref_mp.left_P_.copy()
          # ref_left_I = ref_mp.left_I_
  
          naive.replace_inf(ref_P)
          naive.replace_inf(ref_left_P)
          naive.replace_inf(comp_P)
          naive.replace_inf(comp_left_P)
  
          npt.assert_almost_equal(ref_P, comp_P)
          # npt.assert_almost_equal(ref_I, comp_I)
          npt.assert_almost_equal(ref_left_P, comp_left_P)
          # npt.assert_almost_equal(ref_left_I, comp_left_I)
  
      np.random.seed(seed)
      T = np.concatenate(
          (
              np.zeros(20, dtype=np.float64),
              np.ones(10, dtype=np.float64),
          )
      )
      T = pd.Series(T)
  
      ref_mp = naive.stumpi_egress(T, m)
      ref_P = ref_mp.P_.copy()
      # ref_I = ref_mp.I_
      ref_left_P = ref_mp.left_P_.copy()
      # ref_left_I = ref_mp.left_I_
  
      stream = stumpi(T, m, egress=True)
  
      comp_P = stream.P_.copy()
      # comp_I = stream.I_
      comp_left_P = stream.left_P_.copy()
      # comp_left_I = stream.left_I_
  
      naive.replace_inf(ref_P)
      naive.replace_inf(ref_left_P)
      naive.replace_inf(comp_P)
      naive.replace_inf(comp_left_P)
  
      npt.assert_almost_equal(ref_P, comp_P)
      # npt.assert_almost_equal(ref_I, comp_I)
      npt.assert_almost_equal(ref_left_P, comp_left_P)
      # npt.assert_almost_equal(ref_left_I, comp_left_I)
  
      for i in range(34):
          t = np.random.rand()
          ref_mp.update(t)
          stream.update(t)
  
          comp_P = stream.P_.copy()
          # comp_I = stream.I_
          comp_left_P = stream.left_P_.copy()
          # comp_left_I = stream.left_I_
  
          ref_P = ref_mp.P_.copy()
          # ref_I = ref_mp.I_
          ref_left_P = ref_mp.left_P_.copy()
          # ref_left_I = ref_mp.left_I_
  
          naive.replace_inf(ref_P)
          naive.replace_inf(ref_left_P)
          naive.replace_inf(comp_P)
          naive.replace_inf(comp_left_P)
  
          npt.assert_almost_equal(ref_P, comp_P)
          # npt.assert_almost_equal(ref_I, comp_I)
          npt.assert_almost_equal(ref_left_P, comp_left_P)
  
imports: import functools
  import naive
  import numpy
  import numpy.testing
  import pandas
  import pytest
  from stumpy import config, core, stumpi
label_desc: Use image node_id 9 for calling a global function with example usage: test_stumpi_constant_subsequence_self_join_egress() without return types