import mmh3
from bitarray import bitarray
class BloomFilter:
   def __init__(self, size, hash_count):
      self.size=size
      self.hash_count=hash_count
      self.bit_array=bitarray(size)
      self.bit_array.setall(0)

  def add(self, string):
       for seed in xrange(self.hash_count):
           result=mmh3.hash(string, seed) % self.size
           self.bit_array[result]=1
 
  def lookup(self, string):
      for seed in xrange(self.hash_count):
          result=mmh3.hash(string,seed) % self.size
          if self.bit_array[result]==0:
              return "Definitely not"
       return "probably"

63e61bd9f273a6734bcce6ebe18fae7a1cd1d64e
import mmh3
from bitarray import bitarray
class BloomFilter:
   def __init__(self, size, hash_count):
      self.size=size
      self.hash_count=hash_count
      self.bit_array=bitarray(size)
      self.bit_array.setall(0)

  def add(self, string):
       for seed in xrange(self.hash_count):
           result=mmh3.hash(string, seed) % self.size
           self.bit_array[result]=1
 
  def lookup(self, string):
      for seed in xrange(self.hash_count):
          result=mmh3.hash(string,seed) % self.size
          if self.bit_array[result]==0:
              return "Definitely not"
       return "probably"
