// newRecordset generates a new RecordSet instance.
180664
func newRecordset(recSize, goroutines int, taskID uint64) *Recordset {
	var nilChan chan *struct{}

	rs := &Recordset{
		Records:   make(chan *Record, recSize),
		objectset: *newObjectset(reflect.ValueOf(nilChan), goroutines, taskID),
	}

	runtime.SetFinalizer(rs, recordsetFinalizer)
	return rs
}
86370
func New(c rest.Interface) *Clientset {
	var cs Clientset
	cs.apiregistrationV1beta1 = apiregistrationv1beta1.New(c)
	cs.apiregistrationV1 = apiregistrationv1.New(c)

	cs.DiscoveryClient = discovery.NewDiscoveryClient(c)
	return &cs
}
917059
func New() *Pget {
	return &Pget{
		Trace:   false,
		Utils:   &Data{},
		Procs:   runtime.NumCPU(), // default
		timeout: 10,
	}
}
1194828
func (m *RecordCollectionManager) NewRecordDocument(r *common.Record) (string, error) {
	r.RecordID = uuid.NewV4().String()
	_, err := m.manager.col.Upsert(bson.M{"_id": r.RecordID}, r)
	return r.RecordID, err
}
1119689
func New(c rest.Interface) *Clientset {
	var cs Clientset
	cs.apiregistration = apiregistrationinternalversion.New(c)

	cs.DiscoveryClient = discovery.NewDiscoveryClient(c)
	return &cs
}
1271188
func NewResultSet() *ResultSet {
	return &ResultSet{
		Fields:    make([]string, 0),
		Values:    make([]*reflect.Value, 0),
		NameIndex: make(map[string]int),
		Length:    0,
	}
}
1010729
func NewIntSet(items ...int) IntSet {
	ss := IntSet{}
	ss.Insert(items...)
	return ss
}
402423
func newPrettyRecord(indent int, rows ...Row) PrettyRecord {
	maxDescLen := 0
	for _, r := range rows {
		if len(r.desc) > maxDescLen {
			maxDescLen = len(r.desc)
		}
	}
	return PrettyRecord{
		rows:   rows,
		indent: indent,
		maxLen: maxDescLen,
	}
}
626802
func newQuerySet(orm *orm, mi *modelInfo) QuerySeter {
	o := new(querySet)
	o.mi = mi
	o.orm = orm
	return o
}
275540
func flattenAzureRmDnsNsRecordsSet(records *[]dns.NsRecord) []map[string]interface{} {
	results := make([]map[string]interface{}, 0, len(*records))

	if records != nil {
		for _, record := range *records {
			nsRecord := make(map[string]interface{})
			nsRecord["nsdname"] = *record.Nsdname
			results = append(results, nsRecord)
		}
	}

	return results
}
520476
func NewValueSet(values ...Value) ValueSet {
	set := make(ValueSet)

	for _, value := range values {
		set.Add(value)
	}

	return set
}
563149
func NewReplicaSet(g osgraph.Graph, rsNode *kubenodes.ReplicaSetNode) (ReplicaSet, IntSet) {
	covered := IntSet{}
	covered.Insert(rsNode.ID())

	rsView := ReplicaSet{}
	rsView.RS = rsNode

	for _, uncastPodNode := range g.PredecessorNodesByEdgeKind(rsNode, appsgraph.ManagedByControllerEdgeKind) {
		podNode := uncastPodNode.(*kubenodes.PodNode)
		covered.Insert(podNode.ID())
		rsView.OwnedPods = append(rsView.OwnedPods, podNode)
	}

	return rsView, covered
}
848522
func NewSet(host *Host, name string) (*Set, error) {
	s := &Set{host, pq.QuoteIdentifier(name)} // name is the name of the table
	// list is the name of the column
	if _, err := s.host.db.Exec(fmt.Sprintf("CREATE TABLE IF NOT EXISTS %s (%s %s)", s.table, setCol, defaultStringType)); err != nil {
		if !strings.HasSuffix(err.Error(), "already exists") {
			return nil, err
		}
	}
	if Verbose {
		log.Println("Created table " + s.table + " in database " + host.dbname)
	}
	return s, nil
}
287380
func NewVersionSet(apiVersions ...string) VersionSet {
	vs := VersionSet{}
	for _, v := range apiVersions {
		vs[v] = struct{}{}
	}
	return vs
}
449681
func newAccountSet(signer types.Signer) *accountSet {
	return &accountSet{
		accounts: make(map[common.Address]struct{}),
		signer:   signer,
	}
}
106286
func (s *AwsSecurityFinding) SetRecordState(v string) *AwsSecurityFinding {
	s.RecordState = &v
	return s
}
500591
func (runner *runner) CreateSet(set *IPSet, ignoreExistErr bool) error {
	// sets some IPSet fields if not present to their default values.
	set.setIPSetDefaults()

	// Validate ipset before creating
	valid := set.Validate()
	if !valid {
		return fmt.Errorf("error creating ipset since it's invalid")
	}
	return runner.createSet(set, ignoreExistErr)
}