code: def cosine(a: np.array, b: np.array) -> np.array:
      return np.linalg.norm(a * b) / (
          np.linalg.norm(a) * np.linalg.norm(b)
      )
  
file_path: scattertext/scattertext/categorygrouping/characteristic_grouper.py
imports: from typing import List, Optional, Callable, Dict, Tuple
  import pandas
  import numpy
  from scipy.stats import spearmanr
  from tqdm.auto import tqdm
  from scattertext.TermDocMatrix import TermDocMatrix
  from scattertext.categorygrouping.characteristic_embedder_base import CategoryEmbedderABC
  from scattertext.categorygrouping.rank_embedder import RankEmbedder
label_desc: Use image node_id 1 for calling a global function with example usage: cosine(a, b) and returns: unknown