Return a new ``<Override>`` element with attributes set to parameter
        values.
971369
def new(partname, content_type):
        
        xml = '<Override xmlns="%s"/>' % nsmap['ct']
        override = parse_xml(xml)
        override.set('PartName', partname)
        override.set('ContentType', content_type)
        return override
1185581
def get_and_setattr(cls, id, **kwargs):
        
        model = cls.get(id)
        for k, v in cls._preprocess_params(kwargs).items():
            setattr(model, k, v)
        return model
986313
public static ParameterizedBy element(Class<? extends By> byClass, String variableName) {
        return new ParameterizedBy(byClass, variableName);
    }
1146219
function createOverride(sXHRMethod) {

		mRegistry[sXHRMethod] = Object.create(null);

		//  backup the original function
		mXHRFunctions[sXHRMethod] = window.XMLHttpRequest.prototype[sXHRMethod];

		window.XMLHttpRequest.prototype[sXHRMethod] = function() {
			var oArgs = arguments;

			// call the original function first
			mXHRFunctions[sXHRMethod].apply(this, oArgs);

			// call the registered callbacks in order of their registration
			for (var sName in mRegistry[sXHRMethod]) {
				mRegistry[sXHRMethod][sName].apply(this, oArgs);
			}

		};

	}
389195
def element( i )
      values = @values.collect do |value|
        value.dimension == 0 ? value : value.element( i )
      end
      self.class.new( *values ).demand
    end
1264290
def extend(self, **kwargs):
    """"""

    props = self.copy()
    props.update(kwargs)
    return TemplateData(**props)
743434
def add_element(self, elt):
        """"""
        if not isinstance(elt, Element):
            raise TypeError("argument should be a subclass of Element")
        self.elements[elt.get_name()] = elt
        return elt
484382
def setReturnParameter(self, name, type, namespace=None, element_type=0):
        """"""
        parameter = ParameterInfo(name, type, namespace, element_type)
        self.retval = parameter
        return parameter
1093959
def overrides(method):
    '''
    
    '''
    def wrapper(func):
        if func.__name__ != method.__name__:
            msg = "Wrong @override: %r expected, but overwriting %r."
            msg = msg % (func.__name__, method.__name__)
            raise AssertionError(msg)

        if func.__doc__ is None:
            func.__doc__ = method.__doc__

        return func

    return wrapper
697390
def new(cls, **kwargs):
        
        kwargs = cls.preprocess_kwargs_before_new(kwargs)
        if cls.__mapper__.polymorphic_on is not None:
            discriminator_key = cls.__mapper__.polymorphic_on.name
            discriminator_val = kwargs.get(discriminator_key)
            if discriminator_val is not None and discriminator_val in cls.__mapper__.polymorphic_map:
                actual_cls = cls.__mapper__.polymorphic_map[discriminator_val].class_
                return actual_cls(
                    **subdict(
                        actual_cls._preprocess_params(kwargs),
                        actual_cls.all_settable_keys())
                )
        return cls(**subdict(cls._preprocess_params(kwargs), cls.all_settable_keys()))
11086
def _inherit_context(self, node):
        ''''''

        # Collect the initial list of xml:foo attributes.
        xmlattrs = filter(_IN_XML_NS, _attrs(node))

        # Walk up and get all xml:XXX attributes we inherit.
        inherited, parent = [], node.parentNode
        while parent and parent.nodeType == Node.ELEMENT_NODE:
            for a in filter(_IN_XML_NS, _attrs(parent)):
                n = a.localName
                if n not in xmlattrs:
                    xmlattrs.append(n)
                    inherited.append(a)
            parent = parent.parentNode
        return inherited
1262926
def attributes(self, *args, **kwargs):
        
        self._element.set_attributes(*args, **kwargs)
        return self
780481
def _set(self, name, value):
        ""
        return self.widget(self.widget_element._set(name, value))
89551
function removeOverrides( element, overrides )
	{
		var attributes = overrides && overrides.attributes ;

		if ( attributes )
		{
			for ( var i = 0 ; i < attributes.length ; i++ )
			{
				var attName = attributes[i][0], actualAttrValue ;

				if ( ( actualAttrValue = element.getAttribute( attName ) ) )
				{
					var attValue = attributes[i][1] ;

					// Remove the attribute if:
					//    - The override definition value is null ;
					//    - The override definition valie is a string that
					//      matches the attribute value exactly.
					//    - The override definition value is a regex that
					//      has matches in the attribute value.
					if ( attValue === null ||
							( attValue.test && attValue.test( actualAttrValue ) ) ||
							( typeof attValue == 'string' && actualAttrValue == attValue ) )
						element.removeAttribute( attName ) ;
				}
			}
		}

		removeNoAttribsElement( element );
	}
166492
def _wrap_attr(self, attrs, context=None):
        """"""
        for attr in attrs:
            if isinstance(attr, UnboundMethod):
                if _is_property(attr):
                    yield from attr.infer_call_result(self, context)
                else:
                    yield BoundMethod(attr, self)
            elif hasattr(attr, "name") and attr.name == "<lambda>":
                if attr.args.args and attr.args.args[0].name == "self":
                    yield BoundMethod(attr, self)
                    continue
                yield attr
            else:
                yield attr
1014482
def set_element_attributes(elem_to_parse, **attrib_kwargs):
    

    element = get_element(elem_to_parse)

    if element is None:
        return element

    if len(attrib_kwargs):
        element.attrib.update(attrib_kwargs)

    return element.attrib
677146
def generate_setter(value):
    """"""
    @wraps(set_)
    def setter(self):
        self.set_(value)

    return setter