code: def _run_ems(objective_function, data, cond_idx, train, test):
      """Run EMS."""
      d = objective_function(
          *(data[np.intersect1d(c, train)] for c in cond_idx)
      )
      d /= np.sqrt(np.sum(d**2, axis=0))[None, :]
      # compute surrogates
      return np.sum(data[test[0]] * d, axis=0), d
  
file_path: mne-python/mne/decoding/ems.py
imports: from collections import Counter
  import numpy
  from .._fiff.pick import _picks_to_idx, pick_info, pick_types
  from ..parallel import parallel_func
  from ..utils import logger, verbose
  from .base import _set_cv
  from .mixin import EstimatorMixin, TransformerMixin
label_desc: Use image node_id 3 for calling a global function with example usage: _run_ems(objective_function, data, cond_idx, train, test) and returns: np,  d