Gets the dimension of a Fiona-like geometry element.
19068
def get_dimension(geometry):
    """"""
    coordinates = geometry["coordinates"]
    type_ = geometry["type"]
    if type_ in ('Point',):
        return len(coordinates)
    elif type_ in ('LineString', 'MultiPoint'):
        return len(coordinates[0])
    elif type_ in ('Polygon', 'MultiLineString'):
        return len(coordinates[0][0])
    elif type_ in ('MultiPolygon',):
        return len(coordinates[0][0][0])
    else:
        raise ValueError("Invalid type '{}'".format(type_))
176292
def geom_length(geom):
    
    if geom.geom_type == 'Point':
        return 1
    if hasattr(geom, 'exterior'):
        geom = geom.exterior
    if not geom.geom_type.startswith('Multi') and hasattr(geom, 'array_interface_base'):
        return len(geom.array_interface_base['data'])//2
    else:
        length = 0
        for g in geom:
            length += geom_length(g)
        return length
866080
function getElementSize(element) {
    const rect = element.getBoundingClientRect();
    return {
        width: Math.round(rect.width),
        height: Math.round(rect.height),
    };
}
585476
def dimensions(filenames):
    """"""

    single = type(filenames) is str
    if single:
        filenames = [filenames]
    dims = get_dimensions(filenames)
    if single:
        dims = dims[0]
    return dims
1146173
def parse_dimension(self, node):
        

        try:
            name = node.lattrib['name']
        except:
            self.raise_error('<Dimension> must specify a name')

        description = node.lattrib.get('description', '')

        dim = dict()
        for d in ['l', 'm', 't', 'i', 'k', 'c', 'n']:
            dim[d] = int(node.lattrib.get(d, 0))

        self.model.add_dimension(Dimension(name, description, **dim))
1232512
def GetSize(cls):
    """"""
    format_str = "".join([x[0] for x in cls._fields])
    return struct.calcsize(format_str)
1065355
def get_size(item):
    """"""
    if isinstance(item, (list, set, tuple, dict)):
        return len(item)
    elif isinstance(item, (ndarray, MaskedArray)):
        return item.shape
    elif isinstance(item, Image):
        return item.size
    if isinstance(item, (DataFrame, Index, Series)):
        return item.shape
    else:
        return 1
324046
def dimensions(self):
        """"""
        _, _, width, height = self._extents
        return height, width
592766
def get_size(self, boundary):
        """"""
        if self.filesize is not None:
            valuesize = self.filesize
        else:
            valuesize = len(self.value)

        return len(self.encode_hdr(boundary)) + 2 + valuesize
19537
function getSizes(requestSizes) {
  let width = 0;
  let height = 0;
  if (utils.isArray(requestSizes) && requestSizes.length === 2 &&
    !utils.isArray(requestSizes[0])) {
    width = parseInt(requestSizes[0], 10);
    height = parseInt(requestSizes[1], 10);
  } else if (typeof requestSizes === 'object') {
    for (let i = 0; i < requestSizes.length; i++) {
      let size = requestSizes[i];
      width = parseInt(size[0], 10);
      height = parseInt(size[1], 10);
      break;
    }
  }
  return [width, height];
}
458177
def get_capture_dimensions(capture):
    """"""
    width = int(capture.get(cv2.CAP_PROP_FRAME_WIDTH))
    height = int(capture.get(cv2.CAP_PROP_FRAME_HEIGHT))
    return width, height
496359
def get_minimum_size(self, data):
        """"""
        width = 0
        min_height = 0
        for element in self.elements:
            size = element.get_minimum_size(data)
            min_height = max(min_height, size.y)
            width += size.x
        width += (len(self.elements)-1)*self.margin
        return datatypes.Point(width, min_height)
737854
def node_to_area_geometry(node):
    
    assert "areaGeometry" in node.tag
    for subnode in node.nodes:
        if "Polygon" in subnode.tag:
            crds = [float(x)
                    for x in subnode.nodes[0].nodes[0].nodes[0].text.split()]
            polygon = Polygon([Point(crds[iloc], crds[iloc + 1])
                               for iloc in range(0, len(crds), 2)])
        elif "upperSeismoDepth" in subnode.tag:
            upper_depth = float_(subnode.text)
        elif "lowerSeismoDepth" in subnode.tag:
            lower_depth = float_(subnode.text)
        else:
            # Redundent
            pass
    assert lower_depth > upper_depth
    return polygon, upper_depth, lower_depth
659216
function getGeometry(data) {
  if (data.attributes) {
    validateGeometryAttributes(data.attributes);
    if (data instanceof Geometry) {
      return data;
    } else {
      return new Geometry(data);
    }
  } else if (data.positions || data.POSITION) {
    validateGeometryAttributes(data);
    return new Geometry({
      attributes: data
    });
  }
  throw Error('Invalid mesh');
}
361891
def get_minimum_size(self, data):
        """"""
        min_width = 0
        min_height = 0
        for element in self.elements:
            size = (
                datatypes.Point(0, 0) if element is None
                else element.get_minimum_size(data)
                )
            min_height = max(min_height, size.y)
            min_width = max(min_width, size.x)

        num_elements = len(self.elements)
        height = min_height * num_elements + self.margin * (num_elements-1)
        return datatypes.Point(min_width, height)
192719
def get_size(self):
        
        rec = self.get_rectangle()
        return (int(rec[2]-rec[0]), int(rec[3]-rec[1]))
467949
function getRectangle(el){
                        var box = el.getBoundingClientRect(),
                            top = Math.round(box.top + window.pageYOffset),
                            left = Math.round(box.left + window.pageXOffset),
                            height = typeof el.offsetHeight === 'undefined' ? 0 : el.offsetHeight,
                            width = typeof el.offsetWidth === 'undefined' ? 0 : el.offsetWidth;

                        return { top: top, left: left, height: height, width: width, meanY: top + height / 2}
                    }