code: def test_array_shapes():
      """Test BalancingTransformer when y and w have different shapes."""
      n_samples = 20
      X = np.random.rand(n_samples, 5)
      y = np.random.randint(2, size=n_samples)
      w = np.ones((n_samples, 1))
      dataset = dc.data.NumpyDataset(X, y, w)
      transformer = dc.trans.BalancingTransformer(dataset)
      Xt, yt, wt, ids = transformer.transform_array(
          X, y, w, dataset.ids
      )
      sum0 = np.sum(wt[np.where(y == 0)])
      sum1 = np.sum(wt[np.where(y == 1)])
      assert np.isclose(sum0, sum1)
  
file_path: deepchem/deepchem/trans/tests/test_balancing.py
imports: import itertools
  import tempfile
  import numpy
  import deepchem
label_desc: Use image node_id 6 for calling a global function with example usage: test_array_shapes() without return types