code: function(element, attrs) {
  
              var $element = $(element);
  
              joint.util.forIn(attrs, function(attrs, selector) {
                  var $elements = $element.find(selector).addBack().filter(selector);
                  // Make a special case for setting classes.
                  // We do not want to overwrite any existing class.
                  if (joint.util.has(attrs, 'class')) {
                      $elements.addClass(attrs['class']);
                      attrs = joint.util.omit(attrs, 'class');
                  }
                  $elements.attr(attrs);
              });
          }
docs: Sets attributes on the given element and its descendants based on the selector. `attrs` object: { [SELECTOR1]: { attrs1 }, [SELECTOR2]: { attrs2}, ... } e.g. { 'input': { color : 'red' }}