code: def test_adaptive_hinge_loss_metadata(
      positive_scores,
      many_negative_scores,
      positive_items,
      many_negative_items,
      metadata_a,
      metadata_b,
  ):
      actual = adaptive_hinge_loss(
          positive_scores=positive_scores,
          many_negative_scores=many_negative_scores,
          positive_items=positive_items,
          negative_items=many_negative_items,
          metadata={"a": metadata_a, "b": metadata_b},
          metadata_weights={"a": 0.2, "b": 0.3},
      )
      expected = 61.2829
  
      assert_almost_equal(actual.item(), expected, decimal=3)
  
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 13 for calling a global function with example usage: test_adaptive_hinge_loss_metadata(positive_scores, many_negative_scores, positive_items, many_negative_items, metadata_a, metadata_b) without return types