// NewOverflowBlockElement returns an instance of a new Overflow Block Element
174614
func NewOverflowBlockElement(actionID string, options ...*OptionBlockObject) *OverflowBlockElement {
	return &OverflowBlockElement{
		Type:     metOverflow,
		ActionID: actionID,
		Options:  options,
	}
}
64765
func (p *BlockProducer) NewFilteredBlock(channelID string, filteredTx ...*pb.FilteredTransaction) *pb.FilteredBlock {
	block := NewFilteredBlock(channelID, filteredTx...)
	block.Number = p.blockNum
	atomic.AddUint64(&p.blockNum, 1)
	return block
}
318559
func NewXMLElementFromXMLNode(resp *Response, s *xmlquery.Node) *XMLElement {
	return &XMLElement{
		Name:       s.Data,
		Request:    resp.Request,
		Response:   resp,
		Text:       s.InnerText(),
		DOM:        s,
		attributes: s.Attr,
		isHTML:     false,
	}
}
832952
func newBlockfileStream(rootDir string, fileNum int, startOffset int64) (*blockfileStream, error) {
	filePath := deriveBlockfilePath(rootDir, fileNum)
	logger.Debugf("newBlockfileStream(): filePath=[%s], startOffset=[%d]", filePath, startOffset)
	var file *os.File
	var err error
	if file, err = os.OpenFile(filePath, os.O_RDONLY, 0600); err != nil {
		return nil, errors.Wrapf(err, "error opening block file %s", filePath)
	}
	var newPosition int64
	if newPosition, err = file.Seek(startOffset, 0); err != nil {
		return nil, errors.Wrapf(err, "error seeking block file [%s] to startOffset [%d]", filePath, startOffset)
	}
	if newPosition != startOffset {
		panic(fmt.Sprintf("Could not seek block file [%s] to startOffset [%d]. New position = [%d]",
			filePath, startOffset, newPosition))
	}
	s := &blockfileStream{fileNum, file, bufio.NewReader(file), startOffset}
	return s, nil
}
396676
func NewBlockFilter(backend Backend, block common.Hash, addresses []common.Address, topics [][]common.Hash) *Filter {
	// Create a generic filter and convert it into a block filter
	filter := newFilter(backend, addresses, topics)
	filter.block = block
	return filter
}
476370
func NewOptionsGroupSelectBlockElement(
	optType string,
	placeholder *TextBlockObject,
	actionID string,
	optGroups ...*OptionGroupBlockObject,
) *SelectBlockElement {
	return &SelectBlockElement{
		Type:         optType,
		Placeholder:  placeholder,
		ActionID:     actionID,
		OptionGroups: optGroups,
	}
}
170391
func NewFlowMod(c FlowModCommand, p *PacketIn) *FlowMod {
	var flags FlowModFlag

	switch c {
	case FlowDelete, FlowDeleteStrict:
		// For flow delete requests we cannot set the same flags
		// as for flow insertion and modification.
	default:
		// Use the overlap checking and flow removed notification
		// flags by default for generated message.
		flags = FlowFlagSendFlowRem
	}

	// When the packet-in message was not provided into
	// the constructor, we will use the default values.
	buffer := NoBuffer
	var match Match

	if p != nil {
		buffer, match = p.Buffer, p.Match
	}

	return &FlowMod{
		Command: c,
		Buffer:  buffer,
		Match:   match,
		Flags:   flags,

		// For FlowDelete command, define the output port and
		// group values as "any" to indicate no restrictions.
		OutPort:  PortAny,
		OutGroup: GroupAny,
	}
}
267800
func NewContextBlock(blockID string, elements ...BlockObject) *ContextBlock {
	return &ContextBlock{
		Type:     mbtContext,
		BlockID:  blockID,
		Elements: elements,
	}
}
153290
func newElementBase(ln *line, parent element) elementBase {
	return elementBase{
		ln:     ln,
		parent: parent,
	}
}
2530
func NewFilteredBlockEvent(fblock *pb.FilteredBlock, sourceURL string) *fab.FilteredBlockEvent {
	return &fab.FilteredBlockEvent{
		FilteredBlock: fblock,
		SourceURL:     sourceURL,
	}
}
110000
func New(headerTypes ...cb.HeaderType) fab.BlockFilter {
	return func(block *cb.Block) bool {
		return hasType(block, headerTypes...)
	}
}
719890
func (e *Element) Augment(m ...Markup) {
	if !e.allowChildren {
		return
	}
	for _, mo := range m {
		mo.Apply(e)
	}
}
358722
func NewElementNotFound(msg string, a ...interface{}) ElementNotFound {
	msg = fmt.Sprintf(msg, a...)
	return ElementNotFound{
		error: errors.New(msg),
	}
}
1043997
func newOverlapped() (*syscall.Overlapped, error) {
	event, err := createEvent(nil, true, true, nil)
	if err != nil {
		return nil, err
	}
	return &syscall.Overlapped{HEvent: event}, nil
}
393257
func NewOptionsSelectBlockElement(optType string, placeholder *TextBlockObject, actionID string, options ...*OptionBlockObject) *SelectBlockElement {
	return &SelectBlockElement{
		Type:        optType,
		Placeholder: placeholder,
		ActionID:    actionID,
		Options:     options,
	}
}
877566
func (p *BlockProducer) NewBlock(channelID string, transactions ...*TxInfo) *cb.Block {
	block := NewBlock(channelID, transactions...)
	block.Header.Number = p.blockNum
	atomic.AddUint64(&p.blockNum, 1)
	return block
}
691579
func (plugin *cinderPlugin) NewBlockVolumeMapper(spec *volume.Spec, pod *v1.Pod, _ volume.VolumeOptions) (volume.BlockVolumeMapper, error) {
	// If this is called via GenerateUnmapDeviceFunc(), pod is nil.
	// Pass empty string as dummy uid since uid isn't used in the case.
	var uid types.UID
	if pod != nil {
		uid = pod.UID
	}

	return plugin.newBlockVolumeMapperInternal(spec, uid, &DiskUtil{}, plugin.host.GetMounter(plugin.GetPluginName()))
}