def __init__(self, epsilon, random_state=np.random.RandomState()):
    """Creates a Blip Perturbator.

    Args:
       epsilon: the privacy parameter
       random_state: a numpy.random.RandomState used to draw random numbers
    """
    SketchNoiserBase.__init__(self)
    self._epsilon = epsilon
    self.random_state = random_state
  def __init__(self, random_state, probability=None,
               flip_one_probability=None,
               flip_zero_probability=None):
    """Create a fixed probility bit flip noiser.

    Args:
      random_state: a np.random.RandomState object.
      probability: the probability that a bit will be flipped.
      flip_one_probability: the probability that a one bit will be flipped. It
        will be ignored if probability is given.
      flip_zero_probability: the probability that a zero bit will be flipped. It
        will be ignored if probability is given.
    """
    SketchNoiserBase.__init__(self)
    if probability is not None:
      self._probability = (probability, probability)
    elif flip_one_probability is not None and flip_zero_probability is not None:
      self._probability = (flip_zero_probability, flip_one_probability)
    else:
      raise ValueError("Should provide probability or both "
                       "flip_one_probability and flip_zero_probability.")
    self._random_state = random_state
 def __init__(self, num_random_elements, random_state):
     SketchNoiserBase.__init__(self)
     self.num_random_elements = num_random_elements
     self.random_state = random_state