code: def test_ideal_difference_from_metadata_a_and_b(
      positive_items,
      many_negative_items,
      metadata_a,
      metadata_b,
      metadata_a_and_2_diff,
  ):
      ideal_diff = ideal_difference_from_metadata(
          positive_items=positive_items.repeat(4, 1),
          negative_items=many_negative_items,
          metadata={"a": metadata_a, "b": metadata_b},
          metadata_weights={"a": 0.2, "b": 0.3},
      )
  
      assert_array_equal(ideal_diff, metadata_a_and_2_diff)
  
file_path: collie/tests/test_losses.py
imports: from numpy.testing import assert_almost_equal, assert_array_equal
  import pytest
  import torch
  from collie.loss import adaptive_bpr_loss, adaptive_hinge_loss, bpr_loss, hinge_loss, ideal_difference_from_metadata, warp_loss
label_desc: Use image node_id 4 for calling a global function with example usage: test_ideal_difference_from_metadata_a_and_b(positive_items, many_negative_items, metadata_a, metadata_b, metadata_a_and_2_diff) without return types