code: def test_stumpi_stream_nan_inf_self_join(
      substitute, substitution_locations
  ):
      m = 3
      zone = int(np.ceil(m / 4))
  
      seed = np.random.randint(100000)
  
      for substitution_location in substitution_locations:
          np.random.seed(seed)
          T = np.random.rand(64)
  
          stream = stumpi(T[:30], m, egress=False)
          if substitution_location == -1:
              substitution_location = T[30:].shape[0] - 1
          T[30:][substitution_location] = substitute
          for t in T[30:]:
              stream.update(t)
  
          comp_P = stream.P_
          comp_I = stream.I_
  
          stream.T_[30:][substitution_location] = substitute
          ref_mp = naive.stump(
              stream.T_, m, exclusion_zone=zone, row_wise=True
          )
          ref_P = ref_mp[:, 0]
          ref_I = ref_mp[:, 1]
  
          naive.replace_inf(ref_P)
          naive.replace_inf(comp_P)
  
          npt.assert_almost_equal(ref_P, comp_P)
          npt.assert_almost_equal(ref_I, comp_I)
  
          np.random.seed(seed)
          T = np.random.rand(64)
  
          stream = stumpi(pd.Series(T[:30]), m, egress=False)
          if substitution_location == -1:  # pragma: no cover
              substitution_location = T[30:].shape[0] - 1
          T[30:][substitution_location] = substitute
          for t in T[30:]:
              stream.update(t)
  
          comp_P = stream.P_
          comp_I = stream.I_
  
          naive.replace_inf(comp_P)
  
          npt.assert_almost_equal(ref_P, comp_P)
          npt.assert_almost_equal(ref_I, comp_I)
  
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 6 for calling a global function with example usage: test_stumpi_stream_nan_inf_self_join(substitute, substitution_locations) without return types