code: def test_hinge_loss_metadata(
      positive_scores,
      negative_scores,
      positive_items,
      negative_items,
      metadata_a,
  ):
      actual = hinge_loss(
          positive_scores=positive_scores,
          negative_scores=negative_scores,
          positive_items=positive_items,
          negative_items=negative_items,
          metadata={"a": metadata_a},
          metadata_weights={"a": 0.2},
      )
      expected = (7.3872 + 37.00656384) / 4
  
      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 11 for calling a global function with example usage: test_hinge_loss_metadata(positive_scores, negative_scores, positive_items, negative_items, metadata_a) without return types