code: def test_apply_confidence_inversion(input, expected):
      # test that it inverts correctly
      assert list(
          apply_confidence_inversion(input, "data")["data"]
      ) == pytest.approx(expected)
  
      # test that a KeyError is raised successfully if key not in dict.
      with pytest.raises(KeyError, match=r".* key .*"):
          apply_confidence_inversion({}, "data") == pytest.approx(
              expected
          )
  
file_path: pykale/tests/prepdata/test_tabular_transform.py
imports: import logging
  import numpy
  import pandas
  import pytest
  import torch
  from kale.prepdata.tabular_transform import apply_confidence_inversion, generate_struct_for_qbin, ToOneHotEncoding, ToTensor
  from kale.utils.seed import set_seed
label_desc: Use image node_id 1 for calling a global function with example usage: test_apply_confidence_inversion(input, expected) without return types