code: def test_get_class_weights_binary(self):
      y = np.array([0, 1, 1, 1, 1])
      class_weights = get_class_weights(y, 2)
      assert_array_equal(
          np.array([4.0, 1.0]), 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 1 for calling the ClassWeightsTest obj's underlying member method code with example usage: obj.test_get_class_weights_binary() without return types