code: def test_aampi_update_constant_subsequence_self_join_egress():
      m = 3
  
      seed = np.random.randint(100000)
      np.random.seed(seed)
  
      T_full = np.random.rand(64)  # generate random data
      T_full[40:55] = 3  # add constant level interval
      T_stream = T_full[:10].copy()
  
      ref_mp = naive.aampi_egress(T_stream, m)
      ref_P = ref_mp.P_.copy()
      ref_left_P = ref_mp.left_P_.copy()
  
      stream = aampi(T_stream, m, egress=True)
  
      for i in range(len(T_stream), len(T_full)):
          t = T_full[i]
          ref_mp.update(t)
          stream.update(t)
  
          comp_P = stream.P_.copy()
          comp_left_P = stream.left_P_.copy()
  
          ref_P = ref_mp.P_.copy()
          ref_left_P = ref_mp.left_P_.copy()
  
          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_left_P, comp_left_P)
  
      T_full = pd.Series(T_full)
      T_stream = T_full[:10].copy()
  
      ref_mp = naive.aampi_egress(T_stream, m)
      ref_P = ref_mp.P_.copy()
      ref_left_P = ref_mp.left_P_.copy()
  
      stream = aampi(T_stream, m, egress=True)
  
      for i in range(len(T_stream), len(T_full)):
          t = T_full[i]
          ref_mp.update(t)
          stream.update(t)
  
          comp_P = stream.P_.copy()
          comp_left_P = stream.left_P_.copy()
  
          ref_P = ref_mp.P_.copy()
          ref_left_P = ref_mp.left_P_.copy()
  
          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_left_P, comp_left_P)
  
imports: import naive
  import numpy
  import numpy.testing
  import pandas
  import pytest
  from stumpy import aampi, config, core
label_desc: Use image node_id 11 for calling a global function with example usage: test_aampi_update_constant_subsequence_self_join_egress() without return types