// createSeccompStrategy creates a new seccomp strategy.
356629
func createSeccompStrategy(psp *policy.PodSecurityPolicy) (seccomp.Strategy, error) {
	return seccomp.NewStrategy(psp.Annotations), nil
}
429183
func CreateConsensusEngine(ctx *node.ServiceContext, chainConfig *params.ChainConfig, config *ethash.Config, notify []string, noverify bool, db ethdb.Database) consensus.Engine {
	// If proof-of-authority is requested, set it up
	if chainConfig.Clique != nil {
		return clique.New(chainConfig.Clique, db)
	}
	// Otherwise assume proof-of-work
	switch config.PowMode {
	case ethash.ModeFake:
		log.Warn("Ethash used in fake mode")
		return ethash.NewFaker()
	case ethash.ModeTest:
		log.Warn("Ethash used in test mode")
		return ethash.NewTester(nil, noverify)
	case ethash.ModeShared:
		log.Warn("Ethash used in shared mode")
		return ethash.NewShared()
	default:
		engine := ethash.New(ethash.Config{
			CacheDir:       ctx.ResolvePath(config.CacheDir),
			CachesInMem:    config.CachesInMem,
			CachesOnDisk:   config.CachesOnDisk,
			DatasetDir:     config.DatasetDir,
			DatasetsInMem:  config.DatasetsInMem,
			DatasetsOnDisk: config.DatasetsOnDisk,
		}, notify, noverify)
		engine.SetThreads(-1) // Disable CPU mining
		return engine
	}
}
1130848
func Convert_v1_JenkinsPipelineBuildStrategy_To_build_JenkinsPipelineBuildStrategy(in *v1.JenkinsPipelineBuildStrategy, out *build.JenkinsPipelineBuildStrategy, s conversion.Scope) error {
	return autoConvert_v1_JenkinsPipelineBuildStrategy_To_build_JenkinsPipelineBuildStrategy(in, out, s)
}
50499
func CreateSecret(tx Tx, s *api.Secret) error {
	// Ensure the name is not already in use.
	if tx.lookup(tableSecret, indexName, strings.ToLower(s.Spec.Annotations.Name)) != nil {
		return ErrNameConflict
	}

	return tx.create(tableSecret, s)
}
676481
func (e *Engine) levelCompactionStrategy(group CompactionGroup, fast bool, level compactionLevel) *compactionStrategy {
	return &compactionStrategy{
		group:     group,
		logger:    e.logger.With(zap.Int("tsm1_level", int(level)), zap.String("tsm1_strategy", "level")),
		fileStore: e.FileStore,
		compactor: e.Compactor,
		fast:      fast,
		engine:    e,
		level:     level,
		tracker:   e.compactionTracker,
	}
}
1027540
func createRunAsGroupStrategy(opts *policy.RunAsGroupStrategyOptions) (group.GroupStrategy, error) {
	if opts == nil {
		return group.NewRunAsAny()
	}
	switch opts.Rule {
	case policy.RunAsGroupStrategyMustRunAs:
		return group.NewMustRunAs(opts.Ranges)
	case policy.RunAsGroupStrategyRunAsAny:
		return group.NewRunAsAny()
	case policy.RunAsGroupStrategyMayRunAs:
		return group.NewMayRunAs(opts.Ranges)
	default:
		return nil, fmt.Errorf("Unrecognized RunAsGroup strategy type %s", opts.Rule)
	}
}
80174
func (s *TransformJobDefinition) SetBatchStrategy(v string) *TransformJobDefinition {
	s.BatchStrategy = &v
	return s
}
245298
func LoadStrategy(path string, local, remote func(string) ([]byte, error)) func(string) ([]byte, error) {
	if strings.HasPrefix(path, "http") {
		return remote
	}
	return func(pth string) ([]byte, error) {
		upth, err := pathUnescape(pth)
		if err != nil {
			return nil, err
		}
		return local(filepath.FromSlash(upth))
	}
}
787690
func (c *Client) CreateSecurityGroup(p *CreateSecurityGroupParameter) (*SecurityGroup, error) {
	obj, err := c.Request("createSecurityGroup", convertParamToMap(p))
	if err != nil {
		return nil, err
	}
	return obj.(*SecurityGroup), err
}
879842
func createFSGroupStrategy(opts *policy.FSGroupStrategyOptions) (group.GroupStrategy, error) {
	switch opts.Rule {
	case policy.FSGroupStrategyRunAsAny:
		return group.NewRunAsAny()
	case policy.FSGroupStrategyMayRunAs:
		return group.NewMayRunAs(opts.Ranges)
	case policy.FSGroupStrategyMustRunAs:
		return group.NewMustRunAs(opts.Ranges)
	default:
		return nil, fmt.Errorf("Unrecognized FSGroup strategy type %s", opts.Rule)
	}
}
1060390
func CreateGCECloudWithCloud(config *CloudConfig, c cloud.Cloud) (*Cloud, error) {
	gceCloud, err := CreateGCECloud(config)
	if err == nil {
		gceCloud.c = c
	}
	return gceCloud, err
}
1264638
func NewMockCoreStrategy(ctrl *gomock.Controller) *MockCoreStrategy {
	mock := &MockCoreStrategy{ctrl: ctrl}
	mock.recorder = &MockCoreStrategyMockRecorder{mock}
	return mock
}
1001135
func createCCMessage(messageType pb.ChaincodeMessage_Type, cid string, txid string, cMsg *pb.ChaincodeInput) (*pb.ChaincodeMessage, error) {
	payload, err := proto.Marshal(cMsg)
	if err != nil {
		return nil, err
	}
	ccmsg := &pb.ChaincodeMessage{
		Type:      messageType,
		Payload:   payload,
		Txid:      txid,
		ChannelId: cid,
	}
	return ccmsg, nil
}
1244355
func (h *Heartbeater) SetStrategy(strategy Strategy) *Heartbeater {
	h.Strategy = strategy

	return h
}
655155
func (b *AMQPCeleryBroker) CreateExchange() error {
	return b.ExchangeDeclare(
		b.exchange.Name,
		b.exchange.Type,
		b.exchange.Durable,
		b.exchange.AutoDelete,
		false,
		false,
		nil,
	)
}
489533
func (r *Application) SetUpgradeStrategy(us UpgradeStrategy) *Application {
	r.UpgradeStrategy = &us
	return r
}
1212364
func NewRsyncDaemonStrategy(o *RsyncOptions) CopyStrategy {
	flags := rsyncDefaultFlags
	flags = append(flags, rsyncFlagsFromOptions(o)...)

	remoteExec := newRemoteExecutor(o)

	forwarder := newPortForwarder(o)

	return &rsyncDaemonStrategy{
		Flags:          flags,
		RemoteExecutor: remoteExec,
		LocalExecutor:  newLocalExecutor(),
		PortForwarder:  forwarder,
	}
}