// NewPropertyFetch node constructor
165646
func NewPropertyFetch(Variable node.Node, Property node.Node) *PropertyFetch {
	return &PropertyFetch{
		FreeFloating: nil,
		Variable:     Variable,
		Property:     Property,
	}
}
421335
func (c *Configurator) NewDispatcher(serviceName string, data interface{}) (*yarpc.Dispatcher, error) {
	cfg, err := c.LoadConfig(serviceName, data)
	if err != nil {
		return nil, err
	}
	return yarpc.NewDispatcher(cfg), nil
}
1196803
func NewPropertyFieldTemplate(Name string, Description string, Type *PropertyType) *PropertyFieldTemplate {
	s := new(PropertyFieldTemplate)
	s.Name = Name
	s.Description = Description
	s.Type = Type
	return s
}
1329684
func dbFetchBlockByNode(dbTx database.Tx, node *blockNode) (*btcutil.Block, error) {
	// Load the raw block bytes from the database.
	blockBytes, err := dbTx.FetchBlock(&node.hash)
	if err != nil {
		return nil, err
	}

	// Create the encapsulated block and set the height appropriately.
	block, err := btcutil.NewBlockFromBytes(blockBytes)
	if err != nil {
		return nil, err
	}
	block.SetHeight(node.height)

	return block, nil
}
314555
func GetProperty(disp *ole.IDispatch, name string, params ...interface{}) (result *ole.VARIANT, err error) {
	return disp.InvokeWithOptionalArgs(name, ole.DISPATCH_PROPERTYGET, params)
}
790582
func PutPropertyRef(disp *ole.IDispatch, name string, params ...interface{}) (result *ole.VARIANT, err error) {
	return disp.InvokeWithOptionalArgs(name, ole.DISPATCH_PROPERTYPUTREF, params)
}
304369
func (properties *Properties) AddProperty(newProperty *Property) {
	if newProperty.PropertyID != "" {
		for key, property := range properties.Properties.Items {
			if property.PropertyID == newProperty.PropertyID {
				properties.Properties.Items[key] = newProperty
				return
			}
		}
	}

	newProperty.parent = properties

	properties.Properties.Items = append(properties.Properties.Items, newProperty)
}
39174
func NewArrayDimFetch(Variable node.Node, Dim node.Node) *ArrayDimFetch {
	return &ArrayDimFetch{
		FreeFloating: nil,
		Variable:     Variable,
		Dim:          Dim,
	}
}
967607
func NewPropertiesSearchResult(Matches []*PropertiesSearchMatch) *PropertiesSearchResult {
	s := new(PropertiesSearchResult)
	s.Matches = Matches
	return s
}
20995
func (properties *Properties) NewProperty(contract *Contract, group *Group) *Property {
	property := NewProperty(properties)

	properties.AddProperty(property)

	property.Contract = contract
	property.Group = group
	go property.Contract.GetContract()
	go property.Group.GetGroup()
	go (func(property *Property) {
		groupCompleted := <-property.Group.Complete
		contractCompleted := <-property.Contract.Complete
		property.Complete <- (groupCompleted && contractCompleted)
	})(property)

	return property
}
1157809
func NewFrom(v Values) *Configuration {
	c := &Configuration{
		Os:        EnvironmentOf(mapFetcher(v.Os)),
		gitConfig: git.NewConfig("", ""),
		timestamp: time.Now(),
	}
	c.Git = &delayedEnvironment{
		callback: func() Environment {
			source := &git.ConfigurationSource{
				Lines: make([]string, 0, len(v.Git)),
			}

			for key, values := range v.Git {
				parts := strings.Split(key, ".")
				isCaseSensitive := len(parts) >= 3
				hasUpper := strings.IndexFunc(key, unicode.IsUpper) > -1

				// This branch should only ever trigger in
				// tests, and only if they'd be broken.
				if !isCaseSensitive && hasUpper {
					panic(fmt.Sprintf("key %q has uppercase, shouldn't", key))
				}
				for _, value := range values {
					fmt.Printf("Config: %s=%s\n", key, value)
					source.Lines = append(source.Lines, fmt.Sprintf("%s=%s", key, value))
				}
			}

			return c.readGitConfig(source)
		},
	}
	return c
}
1367695
func (vre *Engine) executeFetchMaybeCreateTable(dbClient binlogplayer.DBClient, query string, maxrows int) (qr *sqltypes.Result, err error) {
	qr, err = dbClient.ExecuteFetch(query, maxrows)

	if err == nil {
		return
	}

	// If it's a bad table or db, it could be because _vt.vreplication wasn't created.
	// In that case we can try creating it again.
	merr, isSQLErr := err.(*mysql.SQLError)
	if !isSQLErr || !(merr.Num == mysql.ERNoSuchTable || merr.Num == mysql.ERBadDb || merr.Num == mysql.ERBadFieldError) {
		return qr, err
	}

	log.Info("Looks like _vt.vreplication table may not exist. Trying to recreate... ")
	if merr.Num == mysql.ERNoSuchTable || merr.Num == mysql.ERBadDb {
		for _, query := range binlogplayer.CreateVReplicationTable() {
			if _, merr := dbClient.ExecuteFetch(query, 0); merr != nil {
				log.Warningf("Failed to ensure _vt.vreplication table exists: %v", merr)
				return nil, err
			}
		}
	}
	if merr.Num == mysql.ERBadFieldError {
		log.Info("Adding column to table _vt.vreplication")
		for _, query := range binlogplayer.AlterVReplicationTable() {
			if _, merr := dbClient.ExecuteFetch(query, 0); merr != nil {
				merr, isSQLErr := err.(*mysql.SQLError)
				if !isSQLErr || !(merr.Num == mysql.ERDupFieldName) {
					log.Warningf("Failed to alter _vt.vreplication table: %v", merr)
					return nil, err
				}
			}
		}
	}
	return dbClient.ExecuteFetch(query, maxrows)
}
6344
func NewBoundContract(address common.Address, abi abi.ABI, caller ContractCaller, transactor ContractTransactor, filterer ContractFilterer) *BoundContract {
	return &BoundContract{
		address:    address,
		abi:        abi,
		caller:     caller,
		transactor: transactor,
		filterer:   filterer,
	}
}
531145
func (p *propertySet) populateProperties(allocs []*structs.Allocation, nodes map[string]*structs.Node,
	properties map[string]uint64) {

	for _, alloc := range allocs {
		nProperty, ok := getProperty(nodes[alloc.NodeID], p.targetAttribute)
		if !ok {
			continue
		}

		properties[nProperty]++
	}
}
493084
func NewLeaseCache(conf *LeaseCacheConfig) (*LeaseCache, error) {
	if conf == nil {
		return nil, errors.New("nil configuration provided")
	}

	if conf.Proxier == nil || conf.Logger == nil {
		return nil, fmt.Errorf("missing configuration required params: %v", conf)
	}

	if conf.Client == nil {
		return nil, fmt.Errorf("nil API client")
	}

	db, err := cachememdb.New()
	if err != nil {
		return nil, err
	}

	// Create a base context for the lease cache layer
	baseCtxInfo := cachememdb.NewContextInfo(conf.BaseContext)

	return &LeaseCache{
		client:      conf.Client,
		proxier:     conf.Proxier,
		logger:      conf.Logger,
		db:          db,
		baseCtxInfo: baseCtxInfo,
		l:           &sync.RWMutex{},
		idLocks:     locksutil.CreateLocks(),
	}, nil
}
538861
func (p *propertySet) PopulateProposed() {

	// Reset the proposed properties
	p.proposedValues = make(map[string]uint64)
	p.clearedValues = make(map[string]uint64)

	// Gather the set of proposed stops.
	var stopping []*structs.Allocation
	for _, updates := range p.ctx.Plan().NodeUpdate {
		stopping = append(stopping, updates...)
	}
	stopping = p.filterAllocs(stopping, false)

	// Gather the proposed allocations
	var proposed []*structs.Allocation
	for _, pallocs := range p.ctx.Plan().NodeAllocation {
		proposed = append(proposed, pallocs...)
	}
	proposed = p.filterAllocs(proposed, true)

	// Get the used nodes
	both := make([]*structs.Allocation, 0, len(stopping)+len(proposed))
	both = append(both, stopping...)
	both = append(both, proposed...)
	nodes, err := p.buildNodeMap(both)
	if err != nil {
		p.errorBuilding = err
		p.logger.Error("failed to build node map", "error", err)
		return
	}

	// Populate the cleared values
	p.populateProperties(stopping, nodes, p.clearedValues)

	// Populate the proposed values
	p.populateProperties(proposed, nodes, p.proposedValues)

	// Remove any cleared value that is now being used by the proposed allocs
	for value := range p.proposedValues {
		current, ok := p.clearedValues[value]
		if !ok {
			continue
		} else if current == 0 {
			delete(p.clearedValues, value)
		} else if current > 1 {
			p.clearedValues[value]--
		}
	}
}
125703
func (c *Client) NewFetchObjectRequest(bucket, key string) *RpbGetReq {
	return &RpbGetReq{
		Bucket: []byte(bucket),
		Key:    []byte(key),
	}
}