The body structure attributes with extension data.
979382
def extended(self) -> ListP:
        """"""
        parts = [part.extended for part in self.parts]
        return ListP([_Concatenated(parts), String.build(self.subtype),
                      _ParamsList(self.content_type_params),
                      String.build(self.content_disposition),
                      String.build(self.content_language),
                      String.build(self.content_location)])
589553
public static void addCustomAttributes(XMLStreamReader xtr, BaseElement element, List<ExtensionAttribute>... blackLists) {
    for (int i = 0; i < xtr.getAttributeCount(); i++) {
      ExtensionAttribute extensionAttribute = new ExtensionAttribute();
      extensionAttribute.setName(xtr.getAttributeLocalName(i));
      extensionAttribute.setValue(xtr.getAttributeValue(i));
      if (StringUtils.isNotEmpty(xtr.getAttributeNamespace(i))) {
        extensionAttribute.setNamespace(xtr.getAttributeNamespace(i));
      }
      if (StringUtils.isNotEmpty(xtr.getAttributePrefix(i))) {
        extensionAttribute.setNamespacePrefix(xtr.getAttributePrefix(i));
      }
      if (!isBlacklisted(extensionAttribute, blackLists)) {
        element.addAttribute(extensionAttribute);
      }
    }
  }
754585
function(attributes) {
        var extendedData = this.createElementNS(this.kmlns, "ExtendedData");
        for (var attributeName in attributes) {
            // empty, name, description, styleUrl attributes ignored
            if (attributes[attributeName] && attributeName != "name" && attributeName != "description" && attributeName != "styleUrl") {
                var data = this.createElementNS(this.kmlns, "Data");
                data.setAttribute("name", attributeName);
                var value = this.createElementNS(this.kmlns, "value");
                if (typeof attributes[attributeName] == "object") {
                    // cater for object attributes with 'value' properties
                    // other object properties will output an empty node
                    if (attributes[attributeName].value) {
                        value.appendChild(this.createTextNode(attributes[attributeName].value));
                    }
                    if (attributes[attributeName].displayName) {
                        var displayName = this.createElementNS(this.kmlns, "displayName");
                        // displayName always written as CDATA
                        displayName.appendChild(this.getXMLDoc().createCDATASection(attributes[attributeName].displayName));
                        data.appendChild(displayName);
                    }
                } else {
                    value.appendChild(this.createTextNode(attributes[attributeName]));
                }
                data.appendChild(value);
                extendedData.appendChild(data);
            }
        }
        if (this.isSimpleContent(extendedData)) {
            return null;
        } else {
            return extendedData;
        }
    }
395366
def element_to_extension_element(element):
    

    exel = ExtensionElement(element.c_tag, element.c_namespace,
                            text=element.text)

    exel.attributes.update(element.extension_attributes)
    exel.children.extend(element.extension_elements)

    for xml_attribute, (member_name, typ, req) in \
            iter(element.c_attributes.items()):
        member_value = getattr(element, member_name)
        if member_value is not None:
            exel.attributes[xml_attribute] = member_value

    exel.children.extend([element_to_extension_element(c) for c in
                          element.children_with_values()])

    return exel
974481
def xdrbody(self, prefix=''):
        """"""
        body = ''
        prefix += indent
        if self.type == 'enum':
            body = ''.join(
                ["%s,\n" % l.xdrout(prefix) for l in self.body[:-1]])
            body += "%s\n" % self.body[-1].xdrout(prefix)
        elif self.type == 'struct':
            body = ''.join(["%s\n" % l.xdrout(prefix) for l in self.body])
        elif self.type == 'union':
            for l in self.body[1:-1]:
                body += ''.join(["%scase %s:\n" % (prefix, case) \
                                 for case in l.cases])
                body += ''.join([
                    "%s\n" % d.xdrout(prefix + indent) for d in l.declarations
                ])
            if self.body[-1].declarations:
                body += "%sdefault:\n" % prefix + \
                        ''.join(["%s\n" % d.xdrout(prefix + indent)
                                 for d in self.body[-1].declarations])
        return body
799662
function nodeExtent(graph, attribute) {
  if (!isGraph(graph))
    throw new Error('graphology-metrics/extent: the given graph is not a valid graphology instance.');

  var attributes = [].concat(attribute);

  var nodes = graph.nodes(),
      node,
      data,
      value,
      key,
      a,
      i,
      l;

  var results = {};

  for (a = 0; a < attributes.length; a++) {
    key = attributes[a];

    results[key] = [Infinity, -Infinity];
  }

  for (i = 0, l = nodes.length; i < l; i++) {
    node = nodes[i];
    data = graph.getNodeAttributes(node);

    for (a = 0; a < attributes.length; a++) {
      key = attributes[a];
      value = data[key];

      if (value < results[key][0])
        results[key][0] = value;

      if (value > results[key][1])
        results[key][1] = value;
    }
  }

  return typeof attribute === 'string' ? results[attribute] : results;
}
855521
def expectedBody(self, data):
        
        bodyLen = None
        if data.len == 1:
            bodyLen = UInt8()
        elif data.len == 2:
            bodyLen = UInt16Be()
        elif data.len == 4:
            bodyLen = UInt32Be()
        else:
            log.error("invalid header length")
            return
        data.readType(bodyLen)
        self.expect(bodyLen.value, self._callbackBody)
593988
def attributes(atts = {}, for_definition = false)
      wrapped_attributes atts, for_definition
      attributes_assignments atts, false, for_definition
      atts
    end
734197
def p_ExtendedAttributeNoArgs(p):
  """"""
  p[0] = model.ExtendedAttribute(
    value=model.ExtendedAttributeValue(name=p[1]))
693145
function parseBODYSTRUCTURE(node, path = []) {
  let curNode = {};
  let i = 0;
  let part = 0;

  if (path.length) {
    curNode.part = path.join('.');
  }

  // multipart
  if (Array.isArray(node[0])) {
    curNode.childNodes = [];
    while (Array.isArray(node[i])) {
      curNode.childNodes.push(parseBODYSTRUCTURE(node[i], path.concat(++part)));
      i++;
    }

    // multipart type
    curNode.type = 'multipart/' + ((node[i++] || {}).value || '').toString().toLowerCase();

    // extension data (not available for BODY requests)

    // body parameter parenthesized list
    if (i < node.length - 1) {
      if (node[i]) {
        curNode.parameters = attributesToObject(node[i]);
      }
      i++;
    }
  } else {
    // content type
    curNode.type = [((node[i++] || {}).value || '').toString().toLowerCase(), ((node[i++] || {}).value || '').toString().toLowerCase()].join('/');

    // body parameter parenthesized list
    if (node[i]) {
      curNode.parameters = attributesToObject(node[i]);
    }
    i++;

    // id
    if (node[i]) {
      curNode.id = ((node[i] || {}).value || '').toString();
    }
    i++;

    // description
    if (node[i]) {
      curNode.description = ((node[i] || {}).value || '').toString();
    }
    i++;

    // encoding
    if (node[i]) {
      curNode.encoding = ((node[i] || {}).value || '').toString().toLowerCase();
    }
    i++;

    // size
    if (node[i]) {
      curNode.size = Number((node[i] || {}).value || 0) || 0;
    }
    i++;

    if (curNode.type === 'message/rfc822') {
      // message/rfc adds additional envelope, bodystructure and line count values

      // envelope
      if (node[i]) {
        curNode.envelope = parseENVELOPE([].concat(node[i] || []));
      }
      i++;

      if (node[i]) {
        curNode.childNodes = [
        // rfc822 bodyparts share the same path, difference is between MIME and HEADER
        // path.MIME returns message/rfc822 header
        // path.HEADER returns inlined message header
        parseBODYSTRUCTURE(node[i], path)];
      }
      i++;

      // line count
      if (node[i]) {
        curNode.lineCount = Number((node[i] || {}).value || 0) || 0;
      }
      i++;
    } else if (/^text\//.test(curNode.type)) {
      // text/* adds additional line count values

      // line count
      if (node[i]) {
        curNode.lineCount = Number((node[i] || {}).value || 0) || 0;
      }
      i++;
    }

    // extension data (not available for BODY requests)

    // md5
    if (i < node.length - 1) {
      if (node[i]) {
        curNode.md5 = ((node[i] || {}).value || '').toString().toLowerCase();
      }
      i++;
    }
  }

  // the following are shared extension values (for both multipart and non-multipart parts)
  // not available for BODY requests

  // body disposition
  if (i < node.length - 1) {
    if (Array.isArray(node[i]) && node[i].length) {
      curNode.disposition = ((node[i][0] || {}).value || '').toString().toLowerCase();
      if (Array.isArray(node[i][1])) {
        curNode.dispositionParameters = attributesToObject(node[i][1]);
      }
    }
    i++;
  }

  // body language
  if (i < node.length - 1) {
    if (node[i]) {
      curNode.language = [].concat(node[i]).map(val => (0, _ramda.propOr)('', 'value', val).toLowerCase());
    }
    i++;
  }

  // body location
  // NB! defined as a "string list" in RFC3501 but replaced in errata document with "string"
  // Errata: http://www.rfc-editor.org/errata_search.php?rfc=3501
  if (i < node.length - 1) {
    if (node[i]) {
      curNode.location = ((node[i] || {}).value || '').toString();
    }
    i++;
  }

  return curNode;
}
393855
function extendData({
  data,
  lengthAngle: totalAngle,
  totalValue,
  paddingAngle,
}) {
  const total = totalValue || sumValues(data);
  const normalizedTotalAngle = valueBetween(totalAngle, -360, 360);
  const numberOfPaddings =
    Math.abs(normalizedTotalAngle) === 360 ? data.length : data.length - 1;
  const degreesTakenByPadding =
    Math.abs(paddingAngle) * numberOfPaddings * Math.sign(normalizedTotalAngle);
  const singlePaddingDegrees = degreesTakenByPadding / numberOfPaddings;
  const degreesTakenByPaths = normalizedTotalAngle - degreesTakenByPadding;
  let lastSegmentEnd = 0;

  return data.map(dataEntry => {
    const valueInPercentage = (dataEntry.value / total) * 100;
    const degrees = extractPercentage(degreesTakenByPaths, valueInPercentage);
    const startOffset = lastSegmentEnd;
    lastSegmentEnd = lastSegmentEnd + degrees + singlePaddingDegrees;

    return {
      percentage: valueInPercentage,
      degrees,
      startOffset,
      ...dataEntry,
    };
  });
}
322499
function attributes(attrs) {
  attrs = attrs || {};
  var ident = attrs.id || '';
  var classes = attrs.classes || [];
  var keyvals = [];
  Object.keys(attrs).forEach(function (k) {
    if (k !== 'classes' && k !== 'id') keyvals.push([k,attrs[k]]);
  });
  return [ident, classes, keyvals];
}
573844
public static void fillAttributes(CmsPreferenceData pref, Element elem) {

        CmsXmlContentProperty prop = pref.getPropertyDefinition();
        for (String[] attrToSet : new String[][] {
            {I_CmsXmlConfiguration.A_VALUE, pref.getDefaultValue()},
            {CmsWorkplaceConfiguration.A_NICE_NAME, prop.getNiceName()},
            {CmsWorkplaceConfiguration.A_DESCRIPTION, prop.getDescription()},
            {CmsWorkplaceConfiguration.A_WIDGET, prop.getConfiguredWidget()},
            {CmsWorkplaceConfiguration.A_WIDGET_CONFIG, prop.getWidgetConfiguration()},
            {CmsWorkplaceConfiguration.A_RULE_REGEX, prop.getRuleRegex()},
            {CmsWorkplaceConfiguration.A_ERROR, prop.getError()}}) {
            String attrName = attrToSet[0];
            String value = attrToSet[1];
            if (value != null) {
                elem.addAttribute(attrName, value);
            }
        }
    }
1049054
def body(self, definitions, body, root):
        
        if root is None:
            body.use = 'literal'
            body.namespace = definitions.tns
            body.parts = ()
            return
        parts = root.get('parts')
        if parts is None:
            body.parts = ()
        else:
            body.parts = re.split('[\s,]', parts)
        body.use = root.get('use', default='literal')
        ns = root.get('namespace')
        if ns is None:
            body.namespace = definitions.tns
        else:
            prefix = root.findPrefix(ns, 'b0')
            body.namespace = (prefix, ns)
661107
protected void storeExtension(Extension e, XMLStreamWriter writer, String elementName) throws XMLStreamException
   {
      writer.writeStartElement(elementName);
      writer.writeAttribute(CommonXML.ATTRIBUTE_CLASS_NAME,
                            e.getValue(CommonXML.ATTRIBUTE_CLASS_NAME,
                                                        e.getClassName()));
      if (e.getModuleName() != null)
         writer.writeAttribute(CommonXML.ATTRIBUTE_MODULE_NAME,
               e.getValue(CommonXML.ATTRIBUTE_MODULE_NAME, e.getModuleName()));
      if (e.getModuleSlot() != null)
         writer.writeAttribute(CommonXML.ATTRIBUTE_MODULE_SLOT,
               e.getValue(CommonXML.ATTRIBUTE_MODULE_SLOT, e.getModuleSlot()));

      if (!e.getConfigPropertiesMap().isEmpty())
      {
         Iterator<Map.Entry<String, String>> it =
            e.getConfigPropertiesMap().entrySet().iterator();

         while (it.hasNext())
         {
            Map.Entry<String, String> entry = it.next();

            writer.writeStartElement(CommonXML.ELEMENT_CONFIG_PROPERTY);
            writer.writeAttribute(CommonXML.ATTRIBUTE_NAME, entry.getKey());
            writer.writeCharacters(e.getValue(CommonXML.ELEMENT_CONFIG_PROPERTY,
                                                               entry.getKey(), entry.getValue()));
            writer.writeEndElement();
         }
      }

      writer.writeEndElement();
   }
227611
def body(self, data):
        """"""
        if data is not None:
            self._body = data
            self.add_header('Content-Length', str(len(self._body)))
1113523
function buildBody({lineDescriptor, timeseriesesByRange}, descriptorFlags,
    revisionInfo) {
  const descriptorParts = getDescriptorParts(lineDescriptor, descriptorFlags);

  // getColor_() uses this to look up this body's head color in colorByLine.
  const descriptor = ChartTimeseries.stringifyDescriptor(lineDescriptor);

  const scalarRowsByLabel = new Map();
  const linkRowsByLabel = new Map();
  const columnCount = timeseriesesByRange.length;
  for (const [columnIndex, {range, timeserieses}] of enumerate(
      timeseriesesByRange)) {
    const setScalar = (rowLabel, value, unit) => setCell(
        scalarRowsByLabel, rowLabel, columnCount, columnIndex, {value, unit});
    const setLink = (rowLabel, href, label) => setCell(
        linkRowsByLabel, rowLabel, columnCount, columnIndex, {href, label});

    DetailsTable.buildCell(setLink, setScalar, timeserieses, range,
        revisionInfo);
  }

  const scalarRows = collectRowsByLabel(scalarRowsByLabel);
  const linkRows = collectRowsByLabel(linkRowsByLabel);
  return {descriptor, descriptorParts, scalarRows, linkRows};
}