<commit_before>package lib

import (
	"bytes"
	"encoding/json"
	"fmt"
	"io"
	"net/http"
)

type layerDetails string

func (l layerDetails) ContentDigest() string {
	return string(l)
}

type tagDetails struct {
	manifest      *parsedManifest
	rawManifest   interface{}
	contentDigest string
	layers        []LayerDetails
}

func (t *tagDetails) RawManifest() interface{} {
	return t.rawManifest
}

func (t *tagDetails) ContentDigest() string {
	return t.contentDigest
}

func (t *tagDetails) RepositoryName() string {
	return t.manifest.Name
}

func (t *tagDetails) TagName() string {
	return t.manifest.Tag
}

func (t *tagDetails) Layers() []LayerDetails {
	return t.layers
}

func (t *tagDetails) setLayers(layers []parsedLayer) {
	t.layers = make([]LayerDetails, 0, len(layers))

	for _, layer := range layers {
		t.layers = append(t.layers, layerDetails(layer.BlobSum))
	}
}

func (r *registryApi) GetTagDetails(ref Refspec) (details TagDetails, err error) {
	url := r.endpointUrl(fmt.Sprintf("v2/%s/manifests/%s", ref.Repository(), ref.Reference()))

	apiResponse, err := r.connector.Get(url, cacheHintTagDetails(ref.Repository()))

	if err != nil {
		return
	}

	if apiResponse.Close {
		defer apiResponse.Body.Close()
	}

	switch apiResponse.StatusCode {
	case http.StatusForbidden, http.StatusUnauthorized:
		err = genericAuthorizationError

	case http.StatusNotFound:
		err = newNotFoundError(fmt.Sprintf("%v: : no such repository or reference", ref))

	case http.StatusOK:

	default:
		err = newInvalidStatusCodeError(apiResponse.StatusCode)
	}

	if err != nil {
		return
	}

	bodyBuffer := bytes.Buffer{}
	_, err = io.Copy(&bodyBuffer, apiResponse.Body)
	if err != nil {
		return<commit_msg>Typo.<commit_after>package lib

import (
	"bytes"
	"encoding/json"
	"fmt"
	"io"
	"net/http"
)

type layerDetails string

func (l layerDetails) ContentDigest() string {
	return string(l)
}

type tagDetails struct {
	manifest      *parsedManifest
	rawManifest   interface{}
	contentDigest string
	layers        []LayerDetails
}

func (t *tagDetails) RawManifest() interface{} {
	return t.rawManifest
}

func (t *tagDetails) ContentDigest() string {
	return t.contentDigest
}

func (t *tagDetails) RepositoryName() string {
	return t.manifest.Name
}

func (t *tagDetails) TagName() string {
	return t.manifest.Tag
}

func (t *tagDetails) Layers() []LayerDetails {
	return t.layers
}

func (t *tagDetails) setLayers(layers []parsedLayer) {
	t.layers = make([]LayerDetails, 0, len(layers))

	for _, layer := range layers {
		t.layers = append(t.layers, layerDetails(layer.BlobSum))
	}
}

func (r *registryApi) GetTagDetails(ref Refspec) (details TagDetails, err error) {
	url := r.endpointUrl(fmt.Sprintf("v2/%s/manifests/%s", ref.Repository(), ref.Reference()))

	apiResponse, err := r.connector.Get(url, cacheHintTagDetails(ref.Repository()))

	if err != nil {
		return
	}

	if apiResponse.Close {
		defer apiResponse.Body.Close()
	}

	switch apiResponse.StatusCode {
	case http.StatusForbidden, http.StatusUnauthorized:
		err = genericAuthorizationError

	case http.StatusNotFound:
		err = newNotFoundError(fmt.Sprintf("%v : no such repository or reference", ref))

	case http.StatusOK:

	default:
		err = newInvalidStatusCodeError(apiResponse.StatusCode)
	}

	if err != nil {
		return
	}

	bodyBuffer := bytes.Buffer{}
	_, err = io.Copy(&bodyBuffer, apiResponse.Body)
	if err != nil {
		return
{'fraction_non_alphanumeric': 0.1273209549071618, 'fraction_numerical': 0.0011788977306218685, 'mean_word_length': 4.509740259740259, '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': '5179645', 'n_tokens_mistral': 1161, 'n_tokens_neox': 1134, 'n_words': 279}