code: def test_attr(self):
      dist_fn = CosineSimilarity()
      distance = BatchedDistance(dist_fn, None)
      # via getattr
      for attr in ["is_inverted", "normalize_embeddings", "p", "power"]:
          self.assertTrue(
              getattr(distance, attr) == getattr(dist_fn, attr)
          )
  
      # using dot
      self.assertTrue(dist_fn.is_inverted == distance.is_inverted)
      self.assertTrue(
          dist_fn.normalize_embeddings == distance.normalize_embeddings
      )
      self.assertTrue(dist_fn.p == distance.p)
      self.assertTrue(dist_fn.power == distance.power)
  
imports: import unittest
  import torch
  from pytorch_metric_learning.distances import BatchedDistance, CosineSimilarity
label_desc: Use image node_id 2 for calling the TestBatchedDistance obj's underlying member method code with example usage: obj.test_attr() without return types