def METHOD_NAME(self, source, result1, result2, mixer, p):
    assume(result1 is not result2)
    def do_map(value):
        rep = repr(value)
        random = Random(hashlib.sha384((mixer + rep).encode()).digest())
        if random.random() <= p:
            return result1
        else:
            return result2
    return source.flatmap(do_map)