Add support for conditional models in Python