@contextlib.contextmanager
def _refcounting(type_):

    gc.collect()
    refcount = len(objgraph.by_type(type_))
    yield refcount
    gc.collect()
    assert len(objgraph.by_type(type_)) <= refcount, \
            "More {0!r} objects still in memory than before."
Estimate the spherical covariance matrices.
dataset/ETHPy150Open spacetelescope/PyFITS/pyfits/tests/test_table.py/_refcounting--crossover with--dataset/ETHPy150Open scikit-learn/scikit-learn/sklearn/mixture/gaussian_mixture.py/_estimate_gaussian_covariance_spherical