code: def naive_multi_match(
      Q,
      T,
      excl_zone,
      max_distance,
      max_matches=None,
      T_subseq_isconstant=None,
      Q_subseq_isconstant=None,
  ):
      m = Q.shape[-1]
      T_subseq_isconstant = naive.rolling_isconstant(
          T, m, T_subseq_isconstant
      )
      Q_subseq_isconstant = naive.rolling_isconstant(
          Q, m, Q_subseq_isconstant
      )
  
      d, n = T.shape
      D_total = np.zeros(n - m + 1, np.float64)
      for i in range(d):
          D = naive.distance_profile(Q[i], T[i], m)
          D[np.isnan(D)] = np.inf
          for j in range(len(D)):
              if np.isfinite(D[j]):
                  if (
                      T_subseq_isconstant[i, j]
                      and Q_subseq_isconstant[i]
                  ):
                      D[j] = 0
                  elif (
                      T_subseq_isconstant[i, j]
                      or Q_subseq_isconstant[i]
                  ):
                      D[j] = np.sqrt(m)
                  else:  # pragma: no cover
                      pass
          D_total[:] = D_total + D
  
      D_mean = D_total / d
  
      return naive.find_matches(
          D_mean, excl_zone, max_distance, max_matches
      )
  
imports: import functools
  import naive
  import numpy
  import numpy.testing
  import pytest
  from stumpy import core, match, motifs
label_desc: Use image node_id 2 for calling a global function with example usage: naive_multi_match(Q, T, excl_zone, max_distance, max_matches, T_subseq_isconstant, Q_subseq_isconstant) and returns: naive