// NewMultiPolygonFlat returns a new MultiPolygon with the given flat coordinates.
482557
func NewMultiPolygonFlat(layout Layout, flatCoords []float64, endss [][]int) *MultiPolygon {
	g := new(MultiPolygon)
	g.layout = layout
	g.stride = layout.Stride()
	g.flatCoords = flatCoords
	g.endss = endss
	return g
}
462219
func newGFPolyFromData(data *bitset.Bitset) gfPoly {
	numTotalBytes := data.Len() / 8
	if data.Len()%8 != 0 {
		numTotalBytes++
	}

	result := gfPoly{term: make([]gfElement, numTotalBytes)}

	i := numTotalBytes - 1
	for j := 0; j < data.Len(); j += 8 {
		result.term[i] = gfElement(data.ByteAt(j))
		i--
	}

	return result
}
1171865
func NewMultiLineStringFlat(layout Layout, flatCoords []float64, ends []int) *MultiLineString {
	g := new(MultiLineString)
	g.layout = layout
	g.stride = layout.Stride()
	g.flatCoords = flatCoords
	g.ends = ends
	return g
}
604285
func newGeometry(input interface{}) interface{} {
	var (
		result      interface{}
		coordinates interface{}
	)
	switch it := input.(type) {
	case map[string]interface{}:
		if _, ok := it[COORDINATES]; ok {
			coordinates = interfaceToArray(it[COORDINATES])
		}
		iType := it[TYPE].(string)
		switch iType {
		case POINT:
			result = NewPoint(coordinates.([]float64))
		case LINESTRING:
			result = NewLineString(coordinates.([][]float64))
		case POLYGON:
			result = NewPolygon(coordinates.([][][]float64))
		case MULTIPOINT:
			result = NewMultiPoint(coordinates.([][]float64))
		case MULTILINESTRING:
			result = NewMultiLineString(coordinates.([][][]float64))
		case MULTIPOLYGON:
			result = NewMultiPolygon(coordinates.([][][][]float64))
		case GEOMETRYCOLLECTION:
			geometries := it["geometries"].([]interface{})
			for inx, geometry := range geometries {
				geometries[inx] = newGeometry(geometry)
			}
			result = NewGeometryCollection(geometries)
		}
	case *Point, *LineString, *Polygon, *MultiPoint, *MultiLineString, *MultiPolygon, *GeometryCollection:
		result = it
	}
	return result
}
1019515
func NewFlatCoordSorting2D(layout geom.Layout, coordData []float64) FlatCoord {
	return NewFlatCoordSorting(layout, coordData, IsLess2D)
}
389214
func (c Core) NewMultipartUpload(bucket, object string, opts PutObjectOptions) (uploadID string, err error) {
	result, err := c.initiateMultipartUpload(context.Background(), bucket, object, opts)
	return result.UploadID, err
}
80479
func NewUlimitOpt(ref *map[string]*units.Ulimit) *UlimitOpt {
	if ref == nil {
		ref = &map[string]*units.Ulimit{}
	}
	return &UlimitOpt{ref}
}
680356
func NewMultiEncrypt(cc ContentEncrypter, kg KeyGenerator, ke ...KeyEncrypter) *MultiEncrypt {
	e := &MultiEncrypt{
		ContentEncrypter: cc,
		KeyGenerator:     kg,
		KeyEncrypters:    ke,
	}
	return e
}
371437
func MultiPolygon(mp orb.MultiPolygon, proj orb.Projection) orb.MultiPolygon {
	for i := range mp {
		mp[i] = Polygon(mp[i], proj)
	}

	return mp
}
770677
func (objMgr *ObjectManager) CreateMultiObject(req *MultiRequest) ([]map[string]interface{}, error) {

	conn := objMgr.connector.(*Connector)
	queryParams := QueryParams{forceProxy: false}
	res, err := conn.makeRequest(CREATE, req, "", queryParams)

	if err != nil {
		return nil, err
	}

	var result []map[string]interface{}
	err = json.Unmarshal(res, &result)

	if err != nil {
		return nil, err
	}

	return result, nil
}
1219961
func (o *MultiCastChannelMap) CreateMultiCastRange(child *MultiCastRange) *bambou.Error {

	return bambou.CurrentSession().CreateChild(o, child)
}
205058
func (l *s3EncObjects) NewMultipartUpload(ctx context.Context, bucket string, object string, o minio.ObjectOptions) (uploadID string, err error) {
	var sseOpts encrypt.ServerSide
	if o.ServerSideEncryption == nil {
		return l.s3Objects.NewMultipartUpload(ctx, bucket, object, minio.ObjectOptions{UserDefined: o.UserDefined})
	}
	// Decide if sse options needed to be passed to backend
	if (minio.GlobalGatewaySSE.SSEC() && o.ServerSideEncryption.Type() == encrypt.SSEC) ||
		(minio.GlobalGatewaySSE.SSES3() && o.ServerSideEncryption.Type() == encrypt.S3) {
		sseOpts = o.ServerSideEncryption
	}

	uploadID, err = l.s3Objects.NewMultipartUpload(ctx, bucket, getGWContentPath(object), minio.ObjectOptions{ServerSideEncryption: sseOpts})
	if err != nil {
		return
	}
	// Create uploadID and write a temporary dare.meta object under object/uploadID prefix
	gwmeta := newGWMetaV1()
	gwmeta.Meta = o.UserDefined
	gwmeta.Stat.ModTime = time.Now().UTC()
	err = l.writeGWMetadata(ctx, bucket, getTmpDareMetaPath(object, uploadID), gwmeta, minio.ObjectOptions{})
	if err != nil {
		return uploadID, minio.ErrorRespToObjectError(err)
	}
	return uploadID, nil
}
1271685
func NewFromPointSet(set *geo.PointSet) *Quadtree {
	q := New(set.Bound(), set.Length())

	ps := []geo.Point(*set)
	for i := range ps {
		q.Insert(&ps[i])
	}

	return q
}
216062
func (f *FlagSets) NewFlagSet(name string) *FlagSet {
	flagSet := NewFlagSet(name)
	flagSet.mainSet = f.mainSet
	flagSet.completions = f.completions
	f.flagSets = append(f.flagSets, flagSet)
	return flagSet
}
1210051
func NewPolynomialFunction(coefficients []float64) *PolynomialFunction {
	if len(coefficients) < 1 {
		return nil
	}
	pf := &PolynomialFunction{
		coefficients: coefficients,
	}
	return pf
}
1185229
func NewCreateMultisigCmd(nRequired int, keys []string) *CreateMultisigCmd {
	return &CreateMultisigCmd{
		NRequired: nRequired,
		Keys:      keys,
	}
}
513654
func deriveCloneMultiPoint(src *MultiPoint) *MultiPoint {
	if src == nil {
		return nil
	}
	dst := new(MultiPoint)
	deriveDeepCopy_4(dst, src)
	return dst
}