Fastapi Return Binary Search Code Python