F5 Python implementation