code: def test_get_class_weights_multi_label(self):
      num_classes = 4
  
      y = np.array(
          [
              [1, 0, 1, 0],
              [1, 1, 0, 0],
              [0, 1, 1, 0],
              [0, 1, 0, 0],
              [1, 1, 0, 0],
              [0, 0, 1, 0],
              [0, 1, 1, 1],
              [1, 1, 0, 1],
          ]
      )
      y = csr_matrix(y, shape=(y.shape[0], num_classes))
  
      class_weights = get_class_weights(y, num_classes)
      assert_array_almost_equal(
          np.array([1.8, 1.0, 1.8, 4.2]), class_weights.cpu().numpy()
      )
  
file_path: small-text/tests/unit/small_text/integrations/pytorch/utils/test_data.py
imports: import unittest
  import numpy
  import pytest
  import torch
  from numpy.testing import assert_array_almost_equal, assert_array_equal
  from scipy.sparse import csr_matrix
  from small_text.integrations.pytorch.exceptions import PytorchNotFoundError
label_desc: Use image node_id 4 for calling the ClassWeightsTest obj's underlying member method code with example usage: obj.test_get_class_weights_multi_label() without return types