Added a hook for patsy.

This is needed by statsmodels and others.