code: def _addNoise(self, pattern, noiseLevel):
      
      if pattern is None:
        return None
  
      newBits = []
      for bit in pattern:
        if random.random() < noiseLevel:
          newBits.append(random.randint(0, max(pattern)))
        else:
          newBits.append(bit)
  
      return set(newBits)
docs: Adds noise the given list of patterns and returns a list of noisy copies.