Scatter search in python