def __init__(self, white_prob=0.05, black_prob=0.05):
        """
        Args:
            white_prob (float), black_prob (float): probabilities setting an element to 255 or 0.
        """
        assert white_prob + black_prob <= 1, "Sum of probabilities cannot be greater than 1"
        super(SaltPepperNoise, self).__init__()
        self._init(locals())

        Args:
            white_prob (float), black_prob (float): probabilities setting an element to 255 or 0.
        
tensorpack/dataflow/imgaug/noise.py