Somewhat obfuscated Python code