Various math-related things in Python code