def set_class_weight(self, class_weight='auto', y=None):

        if class_weight == None:
            cw = None

            try:
                self.clf.set_params(class_weight = cw)
            except ValueError:
                pass
                
        elif class_weight == 'auto':
            c = np.bincount(y)
            ii = np.nonzero(c)[0]
            c = c / float(c.sum())
            cw = dict(zip(ii[::-1],c[ii]))

            try:
                self.clf.set_params(class_weight = cw)
            except ValueError:
                import warnings
                warnings.warn("Tried to set class_weight, but failed. The classifier probably doesn't support it")
Update server then pass on to version-specific controller.
dataset/ETHPy150Open neurosynth/neurosynth/neurosynth/analysis/classify.py/Classifier.set_class_weight--crossover with--dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/api/openstack/compute/legacy_v2/servers.py/Controller.update