import dask
import dask.distributed

import distributed

try:
    import dask.distributed.joblib
except ImportError:
    pass

try:
    import distributed.joblib
except ImportError:
    pass

import sklearn
import sklearn.externals
import sklearn.externals.joblib

Add backwards compatible Distributed Joblib hook
Add backwards compatible Distributed Joblib hook

Depending on the versions of Distributed, Joblib, and scikit-learn,
there are different strategies for registering the Joblib backend. Try
going with the standard Distributed technique first, which may fail for
Distributed 1.24.0+. In other cases, import `joblib` and
`sklearn.externals.joblib`, which should handle this for Dask when
Joblib 0.12.2+ and scikit-learn 0.20.0+ are present. This should ensure
that all three are aware of each other and can work correctly.

This dummy module is only useful internally. So mark it as such. It can
be dropped at any time without explanation once convenient.

Using this design, we can comfortably use this in-place of the other
`import`s we were doing to achieve this effect.
