Add a new product class at once
18179
protected function submitAddProductClass()
    {
        $this->setSubmitted(null, $this->getParam());
        $this->validateComponent('product_class');
        $this->addProductClass();
    }
933231
def add(cls, name, value):
        """"""
        attr = cls(value)
        attr._name = name
        setattr(cls, name, attr)
470778
def add_to_class(self, cls, name):
        '''
        
        '''
        self._name = name
        self._container_model_class = cls
        setattr(cls, name, FieldDescriptor(self))
        self._bound = True
1166918
protected function addProduct()
    {
        if (!$this->isError()) {
            $id = $this->product->add($this->getSubmitted());
            if (empty($id)) {
                $this->errorAndExit($this->text('Unexpected result'));
            }
            $this->line($id);
        }
    }
879996
def _create_products_if_should_run(self):
    

    should_run = False
    if self.context.products.is_required_data('classes_by_source'):
      should_run = True
      make_products = lambda: defaultdict(MultipleRootedProducts)
      self.context.products.safe_create_data('classes_by_source', make_products)

    if self.context.products.is_required_data('product_deps_by_src'):
      should_run = True
      self.context.products.safe_create_data('product_deps_by_src', dict)
    return should_run
1348530
def add_class(self, cls, callback):
        
        if cls.TAG in self._tag_map:
            raise ValueError(
                "duplicate tag: {!r} is already handled by {}".format(
                    cls.TAG,
                    self._tag_map[cls.TAG]))
        self._class_map[cls] = callback
        self._tag_map[cls.TAG] = (cls, callback)
944509
public function editProductClass($product_class_id = null)
    {
        $this->setProductClass($product_class_id);
        $this->setTitleEditProductClass();
        $this->setBreadcrumbEditProductClass();

        $this->setData('can_delete', $this->canDeleteProductClass());
        $this->setData('product_class', $this->data_product_class);

        $this->submitEditProductClass();
        $this->outputEditProductClass();
    }
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;
    }

  }
209415
def add_to_class(self, cls, name):
        '''
        
        '''
        self.model_class = cls
        setattr(cls, name, PhoneNumberDescriptor(self))
        self._bound = True
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
908616
def bulk_add(
        self, item_id, ref_id=None, tags=None, time=None, title=None,
        url=None, wait=True
    ):
        '''
        

        '''
597636
def add_class(cls)
      old_cls = @classes[cls[:name]]
      if !old_cls && @alt_names[cls[:name]]
        old_cls = @alt_names[cls[:name]]
        warn_alt_name(cls)
      end

      if old_cls
        merge_classes(old_cls, cls)
        @current_class = old_cls
      else
        @current_class = cls
        @classes[cls[:name]] = cls

        # Register all alternate names of class for lookup too
        cls[:alternateClassNames].each do |altname|
          if cls[:name] == altname
            # A buggy documentation, warn.
            warn_alt_name(cls)
          else
            @alt_names[altname] = cls
            # When an alternate name has been used as a class name before,
            # then this is one crappy documentation, but attempt to handle
            # it by merging the class with alt-name into this class.
            if @classes[altname]
              merge_classes(cls, @classes[altname])
              @classes.delete(altname)
              warn_alt_name(cls)
            end
          end
        end

        insert_orphans(cls)
      end
    end
400318
public function editProductClassField($product_class_id)
    {
        $this->setProductClassProductClassField($product_class_id);
        $this->setTitleEditProductClassField();
        $this->setBreadcrumbEditProductClassField();

        $this->setData('product_class', $this->data_product_class);
        $this->setData('fields', $this->getUniqueListProductClassField());

        $this->submitEditProductClassField();
        $this->outputEditProductClassField();
    }
135994
function typeClass() {
      Components.Html.root.classList.add(Glide.settings.classes[Glide.settings.type]);
    }
1278794
protected function wizardAddProductClassField()
    {
        // Required
        $this->validatePrompt('product_class_id', $this->text('Product class'), 'product_class_field');
        $this->validatePrompt('field_id', $this->text('Field ID'), 'product_class_field');

        // Optional
        $this->validatePrompt('required', $this->text('Required'), 'product_class_field', 0);
        $this->validatePrompt('multiple', $this->text('Multiple'), 'product_class_field', 0);

        $this->validateComponent('product_class_field');
        $this->addProductClassField();
    }
55306
def add_bootstrap_class(field):
    
    if not isinstance(field.field.widget, (
        django.forms.widgets.CheckboxInput,
        django.forms.widgets.CheckboxSelectMultiple,
        django.forms.widgets.RadioSelect,
        django.forms.widgets.FileInput,
        str
    )):
        field_classes = set(field.field.widget.attrs.get('class', '').split())
        field_classes.add('form-control')
        field.field.widget.attrs['class'] = ' '.join(field_classes)
    return field
745526
def addHandlerClass(clazz):
    """"""
    if not issubclass(clazz, EventHandler):
        raise ValueError("%s must be subclassed from %s" % (clazz, EventHandler))
    _handler_classes[clazz.name] = clazz