<commit_before>package octokit

import (
	"strconv"
	"strings"

	"github.com/jingweno/go-sawyer/mediaheader"
)

const (
	oauthScopes         = "X-OAuth-Scopes"
	oauthAcceptedScopes = "X-OAuth-Accepted-Scopes"
	rateLimitRemaining  = "X-RateLimit-Remaining"
)

type pageable struct {
	NextPage  *Hyperlink
	LastPage  *Hyperlink
	FirstPage *Hyperlink
	PrevPage  *Hyperlink
}

// Result is a pageable set of data, with hyperlinks to the first, last,
// previous, and next pages, containing a response to some request and
// associated error, if any
type Result struct {
	Response *Response
	Err      error
	pageable
}

// HasError returns true if the error field of the Result is not nil; false
// otherwise
func (r *Result) HasError() bool {
	return r.Err != nil
}

// Error returns the string representation of the error if it exists; the
// empty string is returned otherwise
func (r *Result) Error() string {
	if r.Err != nil {
		return r.Err.Error()
	}

	return ""
}


func (r *Result) RateLimitRemaining() int {
	rate, err := strconv.Atoi(r.Response.Header.Get(rateLimitRemaining))
	if err != nil {
		rate = 60
	}
	return rate
}

func (r *Result) RawScopes() string {
	return r.Response.Header.Get(oauthScopes)
}

func (r *Result) Scopes() []string {
	return strings.Split(r.RawScopes(), ",")
}

func (r *Result) RawAcceptedScopes() {
	return r.Response.Header.Get(oauthAcceptedScopes)
}

func (r *Result) AcceptedScopes() []string {
	return strings.Split(r.RawAcceptedScopes(), ",")
}

func (r *Result) ValidScope(scope string) bool {
	for _, s := range r.Scopes() {
		if strings.TrimSpace(s) == scope {
			return true
		}
	}
	return false
}

func newResult(resp *Response, err error) *Result {
	pageable := pageable{}
	if resp != nil {
		fillPageable(&pageable, resp.MediaHeader)
	}
<commit_msg>Fix returning type for `RawAcceptedScopes`<commit_after>package octokit

import (
	"strconv"
	"strings"

	"github.com/jingweno/go-sawyer/mediaheader"
)

const (
	oauthScopes         = "X-OAuth-Scopes"
	oauthAcceptedScopes = "X-OAuth-Accepted-Scopes"
	rateLimitRemaining  = "X-RateLimit-Remaining"
)

type pageable struct {
	NextPage  *Hyperlink
	LastPage  *Hyperlink
	FirstPage *Hyperlink
	PrevPage  *Hyperlink
}

// Result is a pageable set of data, with hyperlinks to the first, last,
// previous, and next pages, containing a response to some request and
// associated error, if any
type Result struct {
	Response *Response
	Err      error
	pageable
}

// HasError returns true if the error field of the Result is not nil; false
// otherwise
func (r *Result) HasError() bool {
	return r.Err != nil
}

// Error returns the string representation of the error if it exists; the
// empty string is returned otherwise
func (r *Result) Error() string {
	if r.Err != nil {
		return r.Err.Error()
	}

	return ""
}


func (r *Result) RateLimitRemaining() int {
	rate, err := strconv.Atoi(r.Response.Header.Get(rateLimitRemaining))
	if err != nil {
		rate = 60
	}
	return rate
}

func (r *Result) RawScopes() string {
	return r.Response.Header.Get(oauthScopes)
}

func (r *Result) Scopes() []string {
	return strings.Split(r.RawScopes(), ",")
}

func (r *Result) RawAcceptedScopes() string {
	return r.Response.Header.Get(oauthAcceptedScopes)
}

func (r *Result) AcceptedScopes() []string {
	return strings.Split(r.RawAcceptedScopes(), ",")
}

func (r *Result) ValidScope(scope string) bool {
	for _, s := range r.Scopes() {
		if strings.TrimSpace(s) == scope {
			return true
		}
	}
	return false
}

func newResult(resp *Response, err error) *Result {
	pageable := pageable{}
	if resp != nil {
		fillPageable(&pageable, resp.MediaHeader)
	}

{'fraction_non_alphanumeric': 0.12107870115575124, 'fraction_numerical': 0.001100715465052284, 'mean_word_length': 3.938858695652174, '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': '6049088', 'n_tokens_mistral': 1290, 'n_tokens_neox': 1253, 'n_words': 371}