Databricks Binary Search Algorithm In Python