code: def test_instance_weights():
      ad = AdultDataset(
          instance_weights_name="fnlwgt", features_to_drop=[]
      )
      privileged_groups = [{"sex": 1}]
      unprivileged_groups = [{"sex": 0}]
      rw = Reweighing(
          unprivileged_groups=unprivileged_groups,
          privileged_groups=privileged_groups,
      )
      transf = rw.fit_transform(ad)
      print(transf.instance_weights.sum())
      assert np.isclose(
          ad.instance_weights.sum(), transf.instance_weights.sum()
      )
  
imports: import numpy
  from aif360.algorithms.preprocessing.reweighing import Reweighing
  from aif360.datasets import AdultDataset
label_desc: Use image node_id 1 for calling a global function with example usage: test_instance_weights() without return types