code: def test_ideal_difference_from_metadata_error(
      positive_items,
      negative_items,
      metadata_a,
      metadata_b,
  ):
      with pytest.raises(
          ValueError,
          match="sum of metadata weights was 1.1, must be <=1",
      ):
          ideal_difference_from_metadata(
              positive_items=positive_items,
              negative_items=negative_items,
              metadata={"a": metadata_a, "b": metadata_b},
              metadata_weights={"a": 0.2, "b": 0.9},
          )
  
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 1 for calling a global function with example usage: test_ideal_difference_from_metadata_error(positive_items, negative_items, metadata_a, metadata_b) without return types