Gets coordinates from a specific element in PLIP XML
432106
def getcoordinates(self, tree, location):
        """"""
        return tuple(float(x) for x in tree.xpath('.//%s/*/text()' % location))
1019027
def coordinates(self):
        
        if self._coordinates is False:
            self._coordinates = None
            self.__pull_combined_properties()
        return self._coordinates
133775
def parse_xml_boundary(xml_region):
        
        try:
            bounds = {}
            for boundary in xml_region.getchildren():
                bounds[boundary.tag] = float(boundary.text)
            bbox = GeographicBB(min_lon=bounds["west"], max_lon=bounds["east"],
                                min_lat=bounds["south"], max_lat=bounds["north"])
            return bbox
        except (KeyError, ValueError):
            raise MapSourceException("region boundaries are invalid. ")
1023698
def get_rectangle(self):
        
        rec = [self.pos[0], self.pos[1]]*2
        for age in self.nodes:
            for node in age:
                # Check max/min for x/y coords
                for i in range(2):
                    if rec[0+i] > node.pos[i]:
                        rec[0+i] = node.pos[i]
                    elif rec[2+i] < node.pos[i]:
                        rec[2+i] = node.pos[i]
        return tuple(rec)
1154657
def parse_elements(elements):
        
        if not len(elements) == 5:
            raise ValueError('Invalid WPL waypoint data')
        # Latitude and longitude are checked for validity during Fix
        # instantiation
        latitude = parse_latitude(elements[0], elements[1])
        longitude = parse_longitude(elements[2], elements[3])
        name = elements[4]
        return Waypoint(latitude, longitude, name)
16498
function getPositionFromOffset(el, of) {
  var offsetParent = getOffsetParent(el);
  var parentOf = getOffset(offsetParent);
  return {
    x: of.x - parentOf.x,
    y: of.y - parentOf.y
  };
}
1055011
private void  parseAttributesPolyLine(SVG.PolyLine obj, Attributes attributes, String tag) throws SVGParseException
   {
      for (int i=0; i<attributes.getLength(); i++)
      {
         if (SVGAttr.fromString(attributes.getLocalName(i)) == SVGAttr.points)
         {
            TextScanner scan = new TextScanner(attributes.getValue(i));
            List<Float> points = new ArrayList<>();
            scan.skipWhitespace();

            while (!scan.empty()) {
               float x = scan.nextFloat();
               if (Float.isNaN(x))
                  throw new SVGParseException("Invalid <"+tag+"> points attribute. Non-coordinate content found in list.");
               scan.skipCommaWhitespace();
               float y = scan.nextFloat();
               if (Float.isNaN(y))
                  throw new SVGParseException("Invalid <"+tag+"> points attribute. There should be an even number of coordinates.");
               scan.skipCommaWhitespace();
               points.add(x);
               points.add(y);
            }
            obj.points = new float[points.size()];
            int j = 0;
            for (float f: points) {
               obj.points[j++] = f;
            }
         }
      }
   }
434390
function(element) {
    var c={};
    try {
      var rect = element.getBoundingClientRect();
      c.x = Math.floor((rect.left + rect.right) / 2);
      c.y = Math.floor((rect.top + rect.bottom) / 2);
    } catch(e) {
      c.x = 1;
      c.y = 1;
    }
    return c;
  }
979794
function getSpliceNodeAtPos(context, pos, loc, value) {
  return createNode({
    start: pos,
    end: pos,
    loc: {start: loc, end: loc},
    __spliceValue: value,
  });
}
1267239
function getCursorPosition(event) {
  let cursorX;
  let cursorY;
  let rect = htmlElement.getBoundingClientRect();
  if (event.touches !== undefined) {
    cursorX = event.touches[0].clientX;
    cursorY = event.touches[0].clientY;
  } else {
    cursorX = event.clientX;
    cursorY = event.clientY;
  }
  return {
    x: cursorX - rect.left,
    y: cursorY - rect.top,
  };
}
734703
function Plist (opts) {
    var file = opts['file'],
        data = opts['data']

    if (file && !data) {
        data = resource(file)
    }


    var parser = new DOMParser(),
        doc = parser.parseFromString(data, 'text/xml'),
        plist = doc.documentElement

    if (plist.tagName != 'plist') {
        throw "Not a plist file"
    }


    // Get first real node
    var node = null
    for (var i = 0, len = plist.childNodes.length; i < len; i++) {
        node = plist.childNodes[i]
        if (node.nodeType == ELEMENT_NODE) {
            break
        }
    }

    this.data = this._parseNode(node)
}
454264
def parse(node)
      node.attributes.each do |key, value|
        case key
        when 'customHeight'
          @custom_height = option_enabled?(node, 'customHeight')
        when 'ht'
          @height = OoxmlSize.new(value.value.to_f, :point)
        when 'hidden'
          @hidden = option_enabled?(node, 'hidden')
        when 'r'
          @index = value.value.to_i
        end
      end
      node.xpath('*').each do |node_child|
        case node_child.name
        when 'c'
          @cells[Coordinates.parse_coordinates_from_string(node_child.attribute('r').value.to_s).column_number.to_i - 1] = XlsxCell.new(parent: self).parse(node_child)
        end
      end
      self
    end
729375
function getGettextPluralPosition(ext, suffix) {
  if (ext) {
    for (let i = 0; i < ext.nplurals; i += 1) {
      if (i === suffix) {
        return i;
      }
    }
  }

  return -1;
}
244939
def parse_elem(element):
        
        ident = int(element.get('id'))
        latitude = element.get('lat')
        longitude = element.get('lon')

        flags = _parse_flags(element)

        return Node(ident, latitude, longitude, *flags)
66375
def parse_xml_point(elem):
    """"""
    point = {}
    units = {}
    for data in elem.findall('data'):
        name = data.get('name')
        unit = data.get('units')
        point[name] = float(data.text) if name != 'date' else parse_iso_date(data.text)
        if unit:
            units[name] = unit
    return point, units
483409
private XmlElement getXMLParam(Object o) throws XMLRPCException {
		XmlElement param = new XmlElement(XMLRPCClient.PARAM);
		XmlElement value = new XmlElement(XMLRPCClient.VALUE);
		param.addChildren(value);
		value.addChildren(serializerHandler.serialize(o));
		return param;
	}
890137
def readLocationElement(self, locationElement):
        
        if self._strictAxisNames and not self.documentObject.axes:
            raise DesignSpaceDocumentError("No axes defined")
        loc = {}
        for dimensionElement in locationElement.findall(".dimension"):
            dimName = dimensionElement.attrib.get("name")
            if self._strictAxisNames and dimName not in self.axisDefaults:
                # In case the document contains no axis definitions,
                self.log.warning("Location with undefined axis: \"%s\".", dimName)
                continue
            xValue = yValue = None
            try:
                xValue = dimensionElement.attrib.get('xvalue')
                xValue = float(xValue)
            except ValueError:
                self.log.warning("KeyError in readLocation xValue %3.3f", xValue)
            try:
                yValue = dimensionElement.attrib.get('yvalue')
                if yValue is not None:
                    yValue = float(yValue)
            except ValueError:
                pass
            if yValue is not None:
                loc[dimName] = (xValue, yValue)
            else:
                loc[dimName] = xValue
        return loc