code: def test_multi_mass_with_isconstant():
      d = 3
      n = 64
      m = 8
  
      # case 1: Q is not multi-subseq of T
      T = np.random.uniform(-1000, 1000, size=[d, n])
      T_subseq_isconstant = np.random.choice(
          [True, False], size=(d, n - m + 1), replace=True
      )
  
      Q = np.random.uniform(-1000, 1000, size=[d, m])
      Q_subseq_isconstant = np.random.choice(
          [True, False], size=(d, 1), replace=True
      )
  
      ref = naive.multi_mass(
          Q,
          T,
          m,
          T_subseq_isconstant=T_subseq_isconstant,
          Q_subseq_isconstant=Q_subseq_isconstant,
      )
  
      T_subseq_isconstant = core.rolling_isconstant(
          T, m, T_subseq_isconstant
      )
      M_T, Σ_T = core.compute_mean_std(T, m)
  
      Q_subseq_isconstant = core.rolling_isconstant(
          Q, m, Q_subseq_isconstant
      )
      μ_Q, σ_Q = core.compute_mean_std(Q, m)
  
      comp = _multi_mass(
          Q,
          T,
          m,
          M_T,
          Σ_T,
          μ_Q,
          σ_Q,
          T_subseq_isconstant=T_subseq_isconstant,
          Q_subseq_isconstant=Q_subseq_isconstant,
      )
  
      npt.assert_almost_equal(
          ref, comp, decimal=config.STUMPY_TEST_PRECISION
      )
  
      # case 2: Q is a multi-subseq of T
      T = np.random.uniform(-1000, 1000, size=[d, n])
      T_subseq_isconstant = np.random.choice(
          [True, False], size=(d, n - m + 1), replace=True
      )
  
      query_idx = np.random.randint(0, n - m + 1)
      Q = T[:, query_idx : query_idx + m]
      Q_subseq_isconstant = np.expand_dims(
          T_subseq_isconstant[:, query_idx], 1
      )
  
      ref = naive.multi_mass(
          Q,
          T,
          m,
          T_subseq_isconstant=T_subseq_isconstant,
          Q_subseq_isconstant=Q_subseq_isconstant,
      )
  
      T_subseq_isconstant = core.rolling_isconstant(
          T, m, T_subseq_isconstant
      )
      M_T, Σ_T = core.compute_mean_std(T, m)
  
      Q_subseq_isconstant = core.rolling_isconstant(
          Q, m, Q_subseq_isconstant
      )
      μ_Q, σ_Q = core.compute_mean_std(Q, m)
  
      comp = _multi_mass(
          Q,
          T,
          m,
          M_T,
          Σ_T,
          μ_Q,
          σ_Q,
          T_subseq_isconstant=T_subseq_isconstant,
          Q_subseq_isconstant=Q_subseq_isconstant,
          query_idx=query_idx,
      )
  
      npt.assert_almost_equal(
          ref, comp, decimal=config.STUMPY_TEST_PRECISION
      )
  
imports: import functools
  import naive
  import numpy
  import numpy.testing
  import pandas
  import pytest
  from stumpy import config, core, mdl, mstump, subspace
  from stumpy.mstump import _get_first_mstump_profile, _get_multi_QT, _multi_mass, multi_distance_profile
label_desc: Use image node_id 24 for calling a global function with example usage: test_multi_mass_with_isconstant() without return types