Set the class name. Also deal with retina, `:hover` css class contexts.
167825
function setSelector(image, options, dynamicBlock, retina) {
	dynamicBlock = dynamicBlock || false;
	retina = retina || false;
	var basename = image.isSVG ? path.basename(image.name, '.svg') : path.basename(image.name, '.png');
	if (retina) {
		// If retina, then '@2x','@3x','_2x','_3x' will be removed.
		basename = _.replace(basename, /[@_](\d)x$/, '');
	}
	var selector = (dynamicBlock ? dynamicBlock : image.dir) + options.cssSeparator + basename;
	if (options.pseudoClass) {
		if (image.name.toLowerCase().indexOf('hover') > -1 || image.name.toLowerCase().indexOf('active') > -1) {
			selector = _.replace(selector, 'Hover', ':hover');
			selector = _.replace(selector, 'Active', ':active');
			selector = _.replace(selector, '_hover', ':hover');
			selector = _.replace(selector, '_active', ':active');
		}
	}
	return selector;
}
201865
def set_name(self, name="My Colormap"):
        
        if not type(name)==str:
            print("set_name(): Name must be a string.")
            return
        self._name = name
        return self
388407
function toggleClass(className) {
  var classes = className.split(/\s+/)
    , name
    , i;
  for(i = 0;i < classes.length;i++) {
    name = classes[i];
    if(this.hasClass(name)) {
      this.removeClass(name)
    }else{
      this.addClass(name)
    }
  }
}
280080
def set_name(self, name):
        
        self.name = name
        self.changed_event.emit(self)
1101346
def add_class(self, c: 'Class') -> None:
        
        self.classes[c.name] = c
        c.parent = self
1148690
function setClasses( classes ) {
    var className = docElement.className;
    var classPrefix = Modernizr._config.classPrefix || '';

    // Change `no-js` to `js` (we do this independently of the `enableClasses`
    // option)
    // Handle classPrefix on this too
    if(Modernizr._config.enableJSClass) {
      var reJS = new RegExp('(^|\\s)'+classPrefix+'no-js(\\s|$)');
      className = className.replace(reJS, '$1'+classPrefix+'js$2');
    }

    if(Modernizr._config.enableClasses) {
      // Add the new classes
      className += ' ' + classPrefix + classes.join(' ' + classPrefix);
      docElement.className = className;
    }

  }
506112
def update_element_css_classes(obj, old_classes, new_classes)
      (old_classes - new_classes).each do |name|
        `#{obj.element}.classList.remove(#{name})`
      end

      (new_classes - old_classes).each do |name|
        `#{obj.element}.classList.add(#{name})`
      end
    end
1084236
def class_method(cls, f):
        """"""
        setattr(cls, f.__name__, classmethod(f))
        return f
306307
def _add_to_class(self, name, method):
        
        if hasattr(self._element_cls, name):
            return
        setattr(self._element_cls, name, method)
103982
def addClass(self, className):
        '''
            
        '''
        className = stripWordsOnly(className)

        if not className:
            return None

        if ' ' in className:
            # Multiple class names passed, do one at a time
            for oneClassName in className.split(' '):
                self.addClass(oneClassName)
            return

        myClassNames = self._classNames

        # Do not allow duplicates
        if className in myClassNames:
            return

        # Regenerate "classNames" and "class" attr.
        #   TODO: Maybe those should be properties?
        myClassNames.append(className)

        return None
708863
function (classPrefix) {
            var text = this._getOutput();

            // Format the prefix for the CSS text
            var prefix = "." + classPrefix + " ";

            var prefixed = this.__prefixingAlgorithm(text, prefix);
            this.__prefixedText = prefixed.text;
            this.__numSelectors = prefixed.selectors;
        }
696666
def contribute_to_class(self, cls, name):
        
        super(SizedImageField, self).contribute_to_class(cls, name)
        signals.post_init.connect(self._set_thumbnail, sender=cls)
470778
def add_to_class(self, cls, name):
        '''
        
        '''
        self._name = name
        self._container_model_class = cls
        setattr(cls, name, FieldDescriptor(self))
        self._bound = True
1215936
public void setStyleClass(java.lang.String styleClass) {
        getStateHelper().put(PropertyKeys.styleClass, styleClass);
    }
352183
function selectorClassNameSpyBefore(className) {
                    /*jshint validthis: true */

                    var context = phantomas.getDOMPath(this);

                    phantomas.incrMetric('DOMqueriesByClassName');
                    phantomas.addOffender('DOMqueriesByClassName', '.%s (in %s)', className, context);

                    phantomas.enterContext({
                        type: 'getElementsByClassName',
                        callDetails: {
                            context: {
                                length: 1,
                                elements: [context]
                            },
                            arguments: ['.' + className]
                        },
                        backtrace: phantomas.getBacktrace()
                    });
                }
933231
def add(cls, name, value):
        """"""
        attr = cls(value)
        attr._name = name
        setattr(cls, name, attr)
289684
def _set_name(self, version=AUTO):
        """"""

        name = 'python'

        if version:
            if version is AUTO:
                version = sys.version_info[0]

                if version == 2:
                    version = ''

            name = '%s%s' % (name, version)

        self.name = name