code: def test_cosine_distance(x1, x2):
      expected_output = torch.tensor(
          [[0.9258, 0.9258], [0.9869, 0.9869]]
      )
      output = calculate_distance(x1, x2, metric=DistanceMetric.COSINE)
      assert torch.allclose(
          output, expected_output, rtol=1e-3, atol=1e-3
      )
  
file_path: pykale/tests/utils/test_distance.py
imports: import pytest
  import torch
  from kale.utils.distance import calculate_distance, DistanceMetric
label_desc: Use image node_id 3 for calling a global function with example usage: test_cosine_distance(x1, x2) without return types