code: def _cosine_distance(a, b, normalized=False):
      sim = np.matmul(a, b.T)
      if not normalized:
          sim = sim / np.dot(
              np.linalg.norm(a, axis=1)[:, np.newaxis],
              np.linalg.norm(b, axis=1)[np.newaxis, :],
          )
      return np.arccos(sim) / np.pi
  
file_path: small-text/small_text/query_strategies/coresets.py
imports: import warnings
  import numpy
  from sklearn.metrics import pairwise_distances
  from small_text.query_strategies.strategies import EmbeddingBasedQueryStrategy
label_desc: Use image node_id 2 for calling a global function with example usage: _cosine_distance(a, b, normalized) and returns: unknown