Stable Diffusion Set Python Intersection Function In R