code: def test_apply_exclusion_zone():
      ts = [1, 2, 3, 4, 5, 6, 7, 8]
      m = 4
  
      # test index 0
      idx = 0
      profile_len = scrimp.calc_profile_len(len(ts), m)  # 4
      exclusion_zone = scrimp.calc_exclusion_zone(m)  # 1
      subsequence = scrimp.next_subsequence(ts, idx, m)
      (
          X,
          n,
          sumx2,
          sumx,
          meanx,
          sigmax2,
          sigmax,
      ) = scrimp.fast_find_nn_pre(ts, m)
      dp = scrimp.calc_distance_profile(
          X, subsequence, n, m, meanx, sigmax
      )
      dp = scrimp.apply_exclusion_zone(
          idx, exclusion_zone, profile_len, dp
      )
  
      expected_dp = np.array(
          [
              np.inf,
              np.inf,
              0.4215e-07,
              0.4215e-07,
              0.4215e-07,
          ]
      )
  
      np.testing.assert_almost_equal(dp, expected_dp)
  
      # test idx 1
      idx = 1
      subsequence = scrimp.next_subsequence(ts, idx, m)
      dp = scrimp.calc_distance_profile(
          X, subsequence, n, m, meanx, sigmax
      )
      dp = scrimp.apply_exclusion_zone(
          idx, exclusion_zone, profile_len, dp
      )
  
      expected_dp = np.array(
          [
              np.inf,
              np.inf,
              np.inf,
              0.4215e-07,
              0.4215e-07,
          ]
      )
  
      np.testing.assert_almost_equal(dp, expected_dp)
  
      # test idx 2
      idx = 2
      subsequence = scrimp.next_subsequence(ts, idx, m)
      dp = scrimp.calc_distance_profile(
          X, subsequence, n, m, meanx, sigmax
      )
      dp = scrimp.apply_exclusion_zone(
          idx, exclusion_zone, profile_len, dp
      )
  
      expected_dp = np.array(
          [
              0.4215e-07,
              np.inf,
              np.inf,
              np.inf,
              0.4215e-07,
          ]
      )
  
      np.testing.assert_almost_equal(dp, expected_dp)
  
      # test idx 3
      idx = 3
      subsequence = scrimp.next_subsequence(ts, idx, m)
      dp = scrimp.calc_distance_profile(
          X, subsequence, n, m, meanx, sigmax
      )
      dp = scrimp.apply_exclusion_zone(
          idx, exclusion_zone, profile_len, dp
      )
  
      expected_dp = np.array(
          [
              0.1115e-06,
              0.0421e-06,
              np.inf,
              np.inf,
              np.inf,
          ]
      )
  
      np.testing.assert_almost_equal(dp, expected_dp)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  import os
  import pytest
  import numpy
  import matrixprofile
  from matrixprofile import scrimp
label_desc: Use image node_id 18 for calling a global function with example usage: test_apply_exclusion_zone() without return types