// WithCluster creates a *Tagger with a brown cluster corpus (a map of strings to the brown clusters).
// If no brown cluster corpus was passed in, the cluster won't be set, and the POSTagger will be less accurate
776726
func WithCluster(c map[string]lingo.Cluster) ConsOpt {
	fn := func(p *Tagger) {
		p.clusters = c
	}
	return fn
}
937447
func (s *ClusterService) AddCluster(p *AddClusterParams) (*AddClusterResponse, error) {
	resp, err := s.cs.newRequest("addCluster", p.toURLValues())
	if err != nil {
		return nil, err
	}

	var r AddClusterResponse
	if err := json.Unmarshal(resp, &r); err != nil {
		return nil, err
	}

	return &r, nil
}
391789
func newCluster() *cluster {
	return &cluster{
		Hasher:     &jmphasher{},
		partitionN: defaultPartitionN,
		ReplicaN:   1,

		joiningLeavingNodes: make(chan nodeAction, 10), // buffered channel
		jobs:                make(map[int64]*resizeJob),
		closing:             make(chan struct{}),
		joining:             make(chan struct{}),

		InternalClient: newNopInternalClient(),

		logger: logger.NopLogger,
	}
}
489075
func (c *Client) AddCluster(p *AddClusterParameter) (*Cluster, error) {
	obj, err := c.Request("addCluster", convertParamToMap(p))
	if err != nil {
		return nil, err
	}
	return obj.(*Cluster), err
}
177943
func (api *API) StatsWithTags(tags []string) stats.StatsClient {
	if api.holder == nil || api.cluster == nil {
		return nil
	}
	return api.holder.Stats.WithTags(tags...)
}
747768
func NewCluster() *Cluster {
	return &Cluster{
		stores:  make(map[uint64]*Store),
		regions: make(map[uint64]*Region),
	}
}
936886
func NewCluster(options *Options) (*Cluster, error) {
    cluster := &Cluster{
	nodes: make(map[string]*redisNode),
	connTimeout: options.ConnTimeout,
	readTimeout: options.ReadTimeout,
	writeTimeout: options.WriteTimeout,
	keepAlive: options.KeepAlive,
	aliveTime: options.AliveTime,
	updateList: make(chan updateMesg),
    }

    for i := range options.StartNodes {
	node := &redisNode{
	    address: options.StartNodes[i],
	    connTimeout: options.ConnTimeout,
	    readTimeout: options.ReadTimeout,
	    writeTimeout: options.WriteTimeout,
	    keepAlive: options.KeepAlive,
	    aliveTime: options.AliveTime,
	}

	err := cluster.update(node)
	if err != nil {
	    continue
	} else {
	    go cluster.handleUpdate()
	    return cluster, nil
	}
    }

    return nil, fmt.Errorf("NewCluster: no valid node in %v", options.StartNodes)
}
654076
func (c *RESTClientset) ListClusters(options metav1.ListOptions) (*kops.ClusterList, error) {
	return c.KopsClient.Clusters(metav1.NamespaceAll).List(options)
}
485216
func NewCluster(site string) *Cluster {
	return &Cluster{
		Site:       site,
		BGPPeers:   make(map[string]*seesaw.Host),
		Nodes:      make(map[string]*seesaw.Node),
		VIPSubnets: make(map[string]*net.IPNet),
		Vservers:   make(map[string]*Vserver),
		VLANs:      make(map[uint16]*seesaw.VLAN),
		Status: seesaw.ConfigStatus{
			Warnings:   make([]string, 0),
			Attributes: make([]seesaw.ConfigMetadata, 0),
		},
	}
}
601292
func (s *DiscoverPollEndpointInput) SetCluster(v string) *DiscoverPollEndpointInput {
	s.Cluster = &v
	return s
}
1124384
func WithTags(ctx context.Context, tags []string) context.Context {
	stats, ok := FromContext(ctx)
	if !ok {
		return ctx
	}
	return WithStats(ctx, &taggedStats{tags, stats})
}
1093932
func (s *Sentinel) GetClusterWithPassword(name string, password string) (c *Cluster, err error) {
	return s.getCluster(name, password)
}
49374
func (s *UpdateTaskSetInput) SetCluster(v string) *UpdateTaskSetInput {
	s.Cluster = &v
	return s
}
659845
func (s *DeregisterContainerInstanceInput) SetCluster(v string) *DeregisterContainerInstanceInput {
	s.Cluster = &v
	return s
}
105836
func (c *VFSClientset) CreateCluster(cluster *kops.Cluster) (*kops.Cluster, error) {
	return c.clusters().Create(cluster)
}
56850
func NewCluster(baseDir string, gitStore bool, logger micrologger.Logger) (*Cluster, error) {
	if !fileExists(baseDir) {
		err := os.Mkdir(baseDir, 0755)
		if err != nil {
			return nil, microerror.Mask(err)
		}
	}

	if gitStore && !isGitRepo(baseDir) {
		err := gitInit(baseDir)
		if err != nil {
			return nil, microerror.Mask(err)
		}
	}

	c := &Cluster{
		baseDir:        baseDir,
		GitStore:       gitStore,
		mu:             new(sync.Mutex),
		Config:         ClusterConfig{},
		predefinedVals: map[string]map[string]string{},
		hostsCache:     map[string]*cachedHost{},
		logger:         logger,
	}

	err := c.Commit("initial commit")
	if err != nil {
		return nil, microerror.Mask(err)
	}
	return c, nil
}
1109175
func NewClusterWithCentroid(centroid *geo.Point, pointers ...geo.Pointer) *Cluster {
	return &Cluster{
		Centroid: centroid.Clone(),
		Pointers: pointers,
	}
}