code: def apply_confidence_inversion(
      data: pd.DataFrame, uncertainty_measure: str
  ) -> Tuple[Any, Any]:
      """Invert a list of numbers, add a small number to avoid division by zero.
  
      Args:
          data (Dict): Dictionary of data to invert.
          uncertainty_measure (str): Key of dict to invert.
  
      Returns:
          Dict: Dictionary with inverted data.
      """
  
      if uncertainty_measure not in data:
          raise KeyError(
              "The key %s not in the dictionary provided"
              % uncertainty_measure
          )
  
      # Make sure no value is less than zero.
      min_not_zero = min(i for i in data[uncertainty_measure] if i > 0)
      data.loc[
          data[uncertainty_measure] < 0, uncertainty_measure
      ] = min_not_zero
      data[uncertainty_measure] = (
          1 / data[uncertainty_measure] + 0.0000000000001
      )
      return data
  
file_path: pykale/kale/prepdata/tabular_transform.py
imports: import os
  from typing import Any, Dict, List, Optional, Tuple
  import pandas
  import torch
  import torch.nn.functional
  from torch import Tensor
label_desc: Use image node_id 1 for calling a global function with example usage: apply_confidence_inversion(data, uncertainty_measure) and returns: data