maybe it'd be better to avoid logic duplication:

```python
id = belongs_to_ensemble(model)
if id:
  return "ensemble/%s" % id
```