code: def from_factor(n):
      if n >= 1:
          return DataAugmentationAmount(
              DataAugmentationAmountReference.ABSOLUTE, int(n), None
          )
      elif n > 0:
          return DataAugmentationAmount(
              DataAugmentationAmountReference.PERCENTAGE, None, n
          )
      elif n == 0:
          return DataAugmentationAmount(
              DataAugmentationAmountReference.PERCENTAGE, 0, 0
          )
      else:
          raise ValueError(
              "Factor must be between (0, +infinity) but got {}".format(
                  n
              )
          )
  
file_path: calamari/calamari_ocr/ocr/augmentation/dataaugmentationparams.py
imports: from tfaip.util.enum import StrEnum
label_desc: Use image node_id 3 for calling the DataAugmentationAmount obj's underlying member method code with example usage: obj.from_factor(n) and returns: DataAugmentationAmount, DataAugmentationAmount, DataAugmentationAmount