code: def test_compute_local_scores(self):
      cav = np.array([[0, 1]])
      dataset_outputs = [
          {"probas": [0.2, 0.8], "cls_emb": [5, 12]},
          {"probas": [0.6, 0.4], "cls_emb": [3, 4]},
      ]
      cos_sim, dot_prods = self.tcav.compute_local_scores(
          cav, dataset_outputs, "cls_emb"
      )
      self.assertListEqual([12, 4], dot_prods)
      # Magnitude of cav is 1, magnitude of cls_embs are [13, 5].
      # Cosine similarity is dot / (cav_mag * cls_embs_mag),
      # which is [12/13, 4/5].
      self.assertListEqual([0.9230769230769231, 0.8], cos_sim)
  
      cav = np.array([[1, 2, 3]])
      dataset_outputs = [
          {"probas": [0.2, 0.8], "cls_emb": [3, 2, 1]},
          {"probas": [0.6, 0.4], "cls_emb": [1, 2, 0]},
      ]
      cos_sim, dot_prods = self.tcav.compute_local_scores(
          cav, dataset_outputs, "cls_emb"
      )
      self.assertListEqual([10, 5], dot_prods)
      self.assertListEqual(
          [0.7142857142857143, 0.5976143046671968], cos_sim
      )
  
imports: from absl.testing import absltest
  from absl.testing import parameterized
  from lit_nlp.api import dataset
  from lit_nlp.api import model
  from lit_nlp.api import types
  from lit_nlp.components import tcav
  import numpy
label_desc: Use image node_id 6 for calling the TCAVTest obj's underlying member method code with example usage: obj.test_compute_local_scores() without return types