// New returns a new Lister.
163738
func New(indexer cache.Indexer, gvr schema.GroupVersionResource) Lister {
	return &dynamicLister{indexer: indexer, gvr: gvr}
}
818679
func New(params *stripe.FileParams) (*stripe.File, error) {
	return getC().New(params)
}
971090
func New(mqURL string) (models.MessageQueue, error) {
	// Play with URL schemes here: https://play.golang.org/p/xWAf9SpCBW
	u, err := url.Parse(mqURL)
	if err != nil {
		logrus.WithError(err).WithFields(logrus.Fields{"url": mqURL}).Fatal("bad MQ URL")
	}
	logrus.WithFields(logrus.Fields{"mq": u.Scheme}).Debug("selecting MQ")
	switch u.Scheme {
	case "memory":
		return NewMemoryMQ(), nil
	case "redis":
		return NewRedisMQ(u)
	case "bolt":
		return NewBoltMQ(u)
	}
	if strings.HasPrefix(u.Scheme, "ironmq") {
		return NewIronMQ(u), nil
	}

	return nil, fmt.Errorf("mq type not supported %v", u.Scheme)
}
140630
func New(transport peer.Transport, opts ...newrr.ListOption) *newrr.List {
	return newrr.New(transport, opts...)
}
1071626
func New(dataCnt, parityCnt int) (r *RS, err error) {

	err = checkCfg(dataCnt, parityCnt)
	if err != nil {
		return
	}

	e := genEncMatrix(dataCnt, parityCnt)
	g := e[dataCnt*dataCnt:]
	r = &RS{DataCnt: dataCnt, ParityCnt: parityCnt,
		encodeMatrix: e, genMatrix: g, inverseMatrix: new(sync.Map)}
	r.enableCache()

	r.cpu = getCPUFeature()

	return
}
1219969
func (factory *TwitterBeeFactory) New(name, description string, options bees.BeeOptions) bees.BeeInterface {
	bee := TwitterBee{
		Bee: bees.NewBee(name, factory.ID(), description, options),
	}
	bee.ReloadOptions(options)

	return &bee
}
818662
func New(scheduler Scheduler, storage Storage, caPath string, nodes ...Node) (*Cluster, error) {
	var (
		c   Cluster
		err error
	)
	if storage == nil {
		return nil, errStorageMandatory
	}
	c.stor = storage
	c.scheduler = scheduler
	if caPath != "" {
		tlsConfig, errTLS := readTLSConfig(caPath)
		if errTLS != nil {
			return nil, errTLS
		}
		c.tlsConfig = tlsConfig
	}
	c.Healer = DefaultHealer{}
	if scheduler == nil {
		c.scheduler = &roundRobin{lastUsed: -1}
	}
	if len(nodes) > 0 {
		for _, n := range nodes {
			err = c.Register(n)
			if err != nil {
				return &c, err
			}
		}
	}
	return &c, err
}
679961
func (factory *SocketBeeFactory) New(name, description string, options bees.BeeOptions) bees.BeeInterface {
	bee := SocketBee{
		Bee: bees.NewBee(name, factory.ID(), description, options),
	}
	bee.ReloadOptions(options)

	return &bee
}
601165
func New(params *stripe.SubscriptionItemParams) (*stripe.SubscriptionItem, error) {
	return getC().New(params)
}
478592
func New(m string, a ...interface{}) error {
	return errors.Wrap(fmt.Errorf(m, a...), 1)
}
243450
func New(params *stripe.SKUParams) (*stripe.SKU, error) {
	return getC().New(params)
}
663880
func (factory *IrcBeeFactory) New(name, description string, options bees.BeeOptions) bees.BeeInterface {
	bee := IrcBee{
		Bee: bees.NewBee(name, factory.ID(), description, options),
	}
	bee.ReloadOptions(options)

	return &bee
}
1170251
func New(c *clientv3.Client, codec runtime.Codec, prefix string, transformer value.Transformer, pagingEnabled bool) storage.Interface {
	return newStore(c, pagingEnabled, codec, prefix, transformer)
}
978803
func New(format string, args ...interface{}) error {
	return annotate(errors.New(fmt.Sprintf(format, args...)), "")
}
1319966
func New(o *rules.Options) *Parser {
	if o == nil {
		return &Parser{options: defaultOptions}
	}
	return &Parser{options: o}
}
945535
func (s *Scheme) New(kind unversioned.GroupVersionKind) (Object, error) {
	obj, err := s.raw.NewObject(kind)
	if err != nil {
		return nil, err
	}
	return obj.(Object), nil
}
1272297
func New(config *localconfig.TopLevel, metricsProvider metrics.Provider, healthChecker healthChecker, migCtrl migration.Controller) (consensus.Consenter, *Metrics) {
	if config.Kafka.Verbose {
		logging.SetLevel(logging.DEBUG, "orderer.consensus.kafka.sarama")
	}

	brokerConfig := newBrokerConfig(
		config.Kafka.TLS,
		config.Kafka.SASLPlain,
		config.Kafka.Retry,
		config.Kafka.Version,
		defaultPartition)

	bootFile := ""
	if config.General.GenesisMethod == "file" {
		bootFile = config.General.GenesisFile
	}

	return &consenterImpl{
		brokerConfigVal: brokerConfig,
		tlsConfigVal:    config.Kafka.TLS,
		retryOptionsVal: config.Kafka.Retry,
		kafkaVersionVal: config.Kafka.Version,
		topicDetailVal: &sarama.TopicDetail{
			NumPartitions:     1,
			ReplicationFactor: config.Kafka.Topic.ReplicationFactor,
		},
		healthChecker:     healthChecker,
		migController:     migCtrl,
		bootstrapFileName: bootFile,
	}, NewMetrics(metricsProvider, brokerConfig.MetricRegistry)
}