Optional imports in Python