code: def cosine_score(stc_true, stc_est, per_sample=True):
      """Compute cosine similarity between 2 source estimates.
  
      Parameters
      ----------
      %(stc_true_metric)s
      %(stc_est_metric)s
      %(per_sample_metric)s
  
      Returns
      -------
      %(stc_metric)s
  
      Notes
      -----
      .. versionadded:: 1.2
      """
      stc_true, stc_est = _uniform_stc(stc_true, stc_est)
      metric = _apply(_cosine, stc_true, stc_est, per_sample=per_sample)
      return metric
  
imports: from functools import partial
  import numpy
  from scipy.spatial.distance import cdist
  from ...utils import _check_option, _validate_type, fill_doc
label_desc: Use image node_id 7 for calling a global function with example usage: cosine_score(stc_true, stc_est, per_sample) and returns: metric