Get the values for the SHAPEWITHSTYLE record.
178879
def _get_struct_shapewithstyle(self, shape_number):
        """"""
        obj = _make_object("ShapeWithStyle")
        obj.FillStyles = self._get_struct_fillstylearray(shape_number)
        obj.LineStyles = self._get_struct_linestylearray(shape_number)
        bc = BitConsumer(self._src)
        obj.NumFillBits = n_fill_bits = bc.u_get(4)
        obj.NumlineBits = n_line_bits = bc.u_get(4)
        obj.ShapeRecords = self._get_shaperecords(
            n_fill_bits, n_line_bits, shape_number)
        return obj
211789
def _estimate_label_shape(self):
        """"""
        max_count = 0
        self.reset()
        try:
            while True:
                label, _ = self.next_sample()
                label = self._parse_label(label)
                max_count = max(max_count, label.shape[0])
        except StopIteration:
            pass
        self.reset()
        return (max_count, label.shape[1])
821971
public static int getStyleId(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes){
        TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.ThemableView, defStyleAttr, defStyleRes);
        int styleId = a.getResourceId(R.styleable.ThemableView_v_styleId, 0);
        a.recycle();

        return styleId;
    }
812030
def shape(self):
        """"""

        # Create C variables that will serve as out parameters for TCMPS.
        shape_ptr = _ctypes.POINTER(_ctypes.c_size_t)()  # size_t* shape_ptr
        dim = _ctypes.c_size_t()                         # size_t dim

        # Obtain pointer into memory owned by the C++ object self.handle.
        status_code = self._LIB.TCMPSGetFloatArrayShape(
            self.handle, _ctypes.byref(shape_ptr), _ctypes.byref(dim))
        assert status_code == 0, "Error calling TCMPSGetFloatArrayShape"

        return _shape_tuple_from_ctypes(shape_ptr, dim)
752256
private static ShapeType getShapeTypeFromGeometryMetaData(GeometryMetaData meta) throws SQLException {
        ShapeType shapeType;
        switch (meta.geometryType) {
            case GeometryTypeCodes.MULTILINESTRING:
            case GeometryTypeCodes.LINESTRING:
            case GeometryTypeCodes.MULTILINESTRINGM:
            case GeometryTypeCodes.LINESTRINGM:
            case GeometryTypeCodes.MULTILINESTRINGZ:
            case GeometryTypeCodes.LINESTRINGZ:
                shapeType = meta.hasZ ? ShapeType.ARCZ : ShapeType.ARC;
                break;
            case GeometryTypeCodes.POINT:
                shapeType = meta.hasZ ? ShapeType.POINTZ  : ShapeType.POINT;
                break;
            case GeometryTypeCodes.MULTIPOINT:
                shapeType = meta.hasZ ? ShapeType.MULTIPOINTZ : ShapeType.MULTIPOINT;
                break;
            case GeometryTypeCodes.POLYGON:
            case GeometryTypeCodes.MULTIPOLYGON:
                shapeType = meta.hasZ ? ShapeType.POLYGONZ : ShapeType.POLYGON;
                break;
            default:
                return null;
        }
        return shapeType;
    }
1145777
def _getStyle(node):
    """
    if node.nodeType == Node.ELEMENT_NODE and len(node.getAttribute('style')) > 0:
        styleMap = {}
        rawStyles = node.getAttribute('style').split(';')
        for style in rawStyles:
            propval = style.split(':')
            if len(propval) == 2:
                styleMap[propval[0].strip()] = propval[1].strip()
        return styleMap
    else:
        return {}
185868
def get_output_shapes(self):
        """"""
        outputs = self.execs[0].outputs
        shapes = [out.shape for out in outputs]

        concat_shapes = []
        for key, the_shape, axis in zip(self.symbol.list_outputs(), shapes, self.output_layouts):
            the_shape = list(the_shape)
            if axis >= 0:
                the_shape[axis] = self.batch_size
            concat_shapes.append((key, tuple(the_shape)))
        return concat_shapes
1093717
def get_by_id(self, style_id, style_type = None):
        

        for st in self.styles.values():
            if st:
                if st.style_id == style_id:
                    return st

        if style_type:
            return self.styles.get(self.default_styles[style_type], None)
        return None
1089300
def get_array_shape(self, key):
        """"""
        data = self.model.get_data()
        return data[key].shape
1303495
def _flds_shape(fieldname, header):
    """"""
    shp = list(header['nts'])
    shp.append(header['ntb'])
    # probably a better way to handle this
    if fieldname == 'Velocity':
        shp.insert(0, 3)
        # extra points
        header['xp'] = int(header['nts'][0] != 1)
        shp[1] += header['xp']
        header['yp'] = int(header['nts'][1] != 1)
        shp[2] += header['yp']
        header['zp'] = 1
        header['xyp'] = 1
    else:
        shp.insert(0, 1)
        header['xp'] = 0
        header['yp'] = 0
        header['zp'] = 0
        header['xyp'] = 0
    return shp
770272
def shape(self):
        ""
        keys = self.keys()
        if self.ndims == 1:
            return (len(keys), 1)
        return len(set(k[0] for k in keys)), len(set(k[1] for k in keys))
210342
def from_record(cls, record, crs):
        """"""
        if 'type' not in record:
            raise TypeError("The data isn't a valid record.")

        return cls(to_shape(record), crs)
909382
def _get_formset_data(self):
        """"""
        data = []
        for datum in self.filtered_data:
            form_data = {}
            for column in self.columns.values():
                value = column.get_data(datum)
                form_data[column.name] = value
            form_data['id'] = self.get_object_id(datum)
            data.append(form_data)
        return data
536845
def read_record(self, dtype, shape=1, byteorder=None):
        """"""
        rec = numpy.rec
        try:
            record = rec.fromfile(self._fh, dtype, shape, byteorder=byteorder)
        except Exception:
            dtype = numpy.dtype(dtype)
            if shape is None:
                shape = self._size // dtype.itemsize
            size = product(sequence(shape)) * dtype.itemsize
            data = self._fh.read(size)
            record = rec.fromstring(data, dtype, shape, byteorder=byteorder)
        return record[0] if shape == 1 else record
835176
def _handle_tag_defineshape(self):
        """"""
        obj = _make_object("DefineShape")
        obj.ShapeId = unpack_ui16(self._src)
        obj.ShapeBounds = self._get_struct_rect()
        obj.Shapes = self._get_struct_shapewithstyle(1)
        return obj
1225380
private static Shape getShapeWithId(String id,
                                        ArrayList<Shape> shapes) {
        Shape result = new Shape(id);
        if (shapes.contains(result)) {
            return shapes.get(shapes.indexOf(result));
        }

        shapes.add(result);
        return result;
    }
1337377
def visitShapeOr(self, ctx: ShExDocParser.ShapeOrContext):
        
        if len(ctx.shapeAnd()) > 1:
            self.expr = ShapeOr(id=self.label, shapeExprs=[])
            for sa in ctx.shapeAnd():
                sep = ShexShapeExpressionParser(self.context)
                sep.visit(sa)
                self.expr.shapeExprs.append(sep.expr)
        else:
            self.visit(ctx.shapeAnd(0))