// NewCloudinary new cloudinary client
772636
func NewCloudinary(ctx context.Context) context.Context {
	return cloudinary.NewContext(ctx, os.Getenv("CLOUDINARY_URL"))
}
886354
func NewClient(auth Auth) *Client {
	return &Client{auth: auth, client: http.DefaultClient}
}
1126099
func NewClient() (*Client, error) {
	cc := ClientConfig{
		ChunkSize:   1420,
		Compression: COMP_GZIP,
	}
	return NewClientWithConfig(cc)
}
1023677
func NewNonInteractiveClientConfig(config clientcmdapi.Config, contextName string, overrides *ConfigOverrides, configAccess ConfigAccess) ClientConfig {
	return &DirectClientConfig{config, contextName, overrides, nil, configAccess, promptedCredentials{}}
}
163145
func New(kubeClient clientset.Interface, cloud cloudprovider.Interface, nodeInformer informers.NodeInformer, allocatorType CIDRAllocatorType, clusterCIDR, serviceCIDR *net.IPNet, nodeCIDRMaskSize int) (CIDRAllocator, error) {
	nodeList, err := listNodes(kubeClient)
	if err != nil {
		return nil, err
	}

	switch allocatorType {
	case RangeAllocatorType:
		return NewCIDRRangeAllocator(kubeClient, nodeInformer, clusterCIDR, serviceCIDR, nodeCIDRMaskSize, nodeList)
	case CloudAllocatorType:
		return NewCloudCIDRAllocator(kubeClient, cloud, nodeInformer)
	default:
		return nil, fmt.Errorf("Invalid CIDR allocator type: %v", allocatorType)
	}
}
632536
func NewClient(namespace string, pool *redis.Pool) *Client {
	return &Client{
		namespace: namespace,
		pool:      pool,
	}
}
224784
func NewGoogleClient(conf *cloudstorage.Config) (client GoogleOAuthClient, err error) {

	switch conf.AuthMethod {
	case AuthGCEDefaultOAuthToken:
		// This token method uses the default OAuth token with GCS created by tools like gsutils, gcloud, etc...
		// See github.com/lytics/lio/src/ext_svcs/google/google_transporter.go : BuildDefaultGoogleTransporter
		client, err = BuildDefaultGoogleTransporter("")
		if err != nil {
			return nil, err
		}
	case AuthGCEMetaKeySource:
		client, err = BuildGCEMetadatTransporter("")
		if err != nil {
			return nil, err
		}
	case AuthJWTKeySource:
		if conf.JwtConf == nil {
			return nil, fmt.Errorf("invalid config: missing jwt config struct")
		}
		// used if you are providing string of json
		client, err = BuildGoogleJWTTransporter(conf.JwtConf)
		if err != nil {
			return nil, err
		}
	case AuthGoogleJWTKeySource:
		switch conf.Scope {
		case "":
			// See the list here: https://github.com/GoogleCloudPlatform/google-cloud-go/blob/master/storage/storage.go#L58-L68
			return nil, fmt.Errorf("invalid config: missing devstorage scope")
		}
		client, err = BuildGoogleFileJWTTransporter(conf.JwtFile, conf.Scope)
		if err != nil {
			return nil, err
		}
	default:
		return nil, fmt.Errorf("bad AuthMethod: %v", conf.AuthMethod)
	}

	return client, err
}
410358
func NewClient() *Client {
	c := new(Client)
	c.SetSoftwareName(DefaultSoftwareName)
	c.logger = NewLogger()
	return c
}
775538
func NewClient(caller FacadeCaller, doer Doer, closer io.Closer) *Client {
	return &Client{
		FacadeCaller: caller,
		Closer:       closer,
		doer:         doer,
	}
}
94919
func NewClient(context *cli.Context, opts ...containerd.ClientOpt) (*containerd.Client, gocontext.Context, gocontext.CancelFunc, error) {
	client, err := containerd.New(context.GlobalString("address"), opts...)
	if err != nil {
		return nil, nil, nil, err
	}
	ctx, cancel := AppContext(context)
	return client, ctx, cancel, nil
}
967847
func NewClient(opts ClientOptions) (*Client, error) {
	err := opts.ensure()
	if err != nil {
		return nil, err
	}

	return &Client{
		logger: log.Get(PkgName),
		opts:   opts,
	}, nil
}
411933
func (c *defaultConfigurator) GetCloudConfig(args environs.StartInstanceParams) (cloudinit.CloudConfig, error) {
	return nil, nil
}
854638
func NewClient(baseAddr string) *Client {
	return &Client{
		baseAddr: baseAddr,
		client:   &http.Client{},
	}
}
344880
func NewCloud(region string) (*Cloud, error) {
	accessToken := os.Getenv("DIGITALOCEAN_ACCESS_TOKEN")
	if accessToken == "" {
		return nil, errors.New("DIGITALOCEAN_ACCESS_TOKEN is required")
	}

	tokenSource := &TokenSource{
		AccessToken: accessToken,
	}

	oauthClient := oauth2.NewClient(oauth2.NoContext, tokenSource)
	client := godo.NewClient(oauthClient)

	return &Cloud{
		Client: client,
		dns:    dns.NewProvider(client),
		Region: region,
	}, nil
}
951434
func NewProvider(config ProviderConfig) (environs.CloudEnvironProvider, error) {
	environProvider, err := NewEnvironProvider(config)
	if err != nil {
		return nil, errors.Trace(err)
	}
	return environProvider, nil
}
854469
func NewCloudSpecAPI(facade base.FacadeCaller, modelTag names.ModelTag) *CloudSpecAPI {
	return &CloudSpecAPI{facade, modelTag}
}
439048
func NewClient(sockPath string) (clitypes.ContainerizedClient, error) {
	if sockPath == "" {
		sockPath = containerdSockPath
	}
	cclient, err := containerd.New(sockPath)
	if err != nil {
		return nil, err
	}
	return &baseClient{
		cclient: cclient,
	}, nil
}