<commit_before>// Package registry provides access to the Torus registry REST API.
package registry

import (
	"context"
	"net/http"
	"net/url"
	"time"

	"github.com/manifoldco/torus-cli/apitypes"
)

// TokenHolder holds an authorization token
type TokenHolder interface {
	Token() string
}

// Client exposes the registry REST API.
type Client struct {
	KeyPairs        *KeyPairsClient
	Tokens          *TokensClient
	Users           *UsersClient
	Teams           *TeamsClient
	Memberships     *MembershipsClient
	Credentials     *Credentials
	Orgs            *OrgsClient
	OrgInvites      *OrgInvitesClient
	Policies        *PoliciesClient
	Projects        *ProjectsClient
	Environments    *EnvironmentsClient
	Services        *ServicesClient
	Keyring         *KeyringClient
	KeyringMember   *KeyringMemberClientV1
	Claims          *ClaimsClient
	ClaimTree       *ClaimTreeClient
	CredentialGraph *CredentialGraphClient
	Machines        *MachinesClient
	Profiles        *ProfilesClient
	Self            *SelfClient
	Version         *VersionClient
}

// NewClient returns a new Client.
func NewClient(prefix string, apiVersion string, version string,
	token TokenHolder, t *http.Transport) *Client {

	rt := &registryRoundTripper{
		DefaultRequestDoer: DefaultRequestDoer{
			Client: &http.Client{Transport: t},
			Host:   prefix,
		},

		apiVersion: apiVersion,
		version:    version,
		holder:     token,
	}

	return NewClientWithRoundTripper(rt)
}

// NewClientWithRoundTripper returns a new Client using the provided
// RoundTripper. This is used in the api package to embed registry endpoints.
func NewClientWithRoundTripper(rt RoundTripper) *Client {
	c := &Client{}
<commit_msg>Use roundtripper instead of http.transport<commit_after>// Package registry provides access to the Torus registry REST API.
package registry

import (
	"context"
	"net/http"
	"net/url"
	"time"

	"github.com/manifoldco/torus-cli/apitypes"
)

// TokenHolder holds an authorization token
type TokenHolder interface {
	Token() string
}

// Client exposes the registry REST API.
type Client struct {
	KeyPairs        *KeyPairsClient
	Tokens          *TokensClient
	Users           *UsersClient
	Teams           *TeamsClient
	Memberships     *MembershipsClient
	Credentials     *Credentials
	Orgs            *OrgsClient
	OrgInvites      *OrgInvitesClient
	Policies        *PoliciesClient
	Projects        *ProjectsClient
	Environments    *EnvironmentsClient
	Services        *ServicesClient
	Keyring         *KeyringClient
	KeyringMember   *KeyringMemberClientV1
	Claims          *ClaimsClient
	ClaimTree       *ClaimTreeClient
	CredentialGraph *CredentialGraphClient
	Machines        *MachinesClient
	Profiles        *ProfilesClient
	Self            *SelfClient
	Version         *VersionClient
}

// NewClient returns a new Client.
func NewClient(prefix string, apiVersion string, version string,
	token TokenHolder, t http.RoundTripper) *Client {

	rt := &registryRoundTripper{
		DefaultRequestDoer: DefaultRequestDoer{
			Client: &http.Client{Transport: t},
			Host:   prefix,
		},

		apiVersion: apiVersion,
		version:    version,
		holder:     token,
	}

	return NewClientWithRoundTripper(rt)
}

// NewClientWithRoundTripper returns a new Client using the provided
// RoundTripper. This is used in the api package to embed registry endpoints.
func NewClientWithRoundTripper(rt RoundTripper) *Client {
	c := &Client{}

{'fraction_non_alphanumeric': 0.06586298147603646, 'fraction_numerical': 0.0005880623346074683, 'mean_word_length': 3.3063291139240505, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1503181', 'n_tokens_mistral': 1040, 'n_tokens_neox': 981, 'n_words': 284}