<commit_before>package t411client

import (
	"bytes"
	"encoding/json"
	"errors"
	"fmt"
	"io"
	"log"
	"net"
	"net/http"
	"net/url"
	"regexp"
	"strings"
	"time"
)

var (
	errNoToken       = errors.New("no token")
	errURLParsing    = errors.New("url parsing error")
	errWrongPassword = &errAPI{
		Code: 107,
		Text: "Wrong password",
	}
	errAccountDisabled = &errAPI{
		Code: 103,
		Text: "Account is disabled",
	}
	errUserNotFound = &errAPI{
		Code: 101,
		Text: "User not found",
	}
	errTokenExpired = &errAPI{
		Code: 201,
		Text: "Token has expired. Please login",
	}
)

// the base url can change every time the t411 api moves from provider
const (
	t411BaseURL = "https://api.t411.li"
	authAPI     = "/auth"
	// UserAgent is the user agent header used in http requests.
	// You can override it if wanted when using t411client package.
	UserAgent    = "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.99 Safari/537.36"
	defaultDelay = 24 * 7 * 2 // 2 weeks
)
<commit_msg>put a string as user agent since when using chrome as part in user agent with the bot and with a chrome browser, it fires 'invalid token' sometimes.<commit_after>package t411client

import (
	"bytes"
	"encoding/json"
	"errors"
	"fmt"
	"io"
	"log"
	"net"
	"net/http"
	"net/url"
	"regexp"
	"strings"
	"time"
)

var (
	errNoToken       = errors.New("no token")
	errURLParsing    = errors.New("url parsing error")
	errWrongPassword = &errAPI{
		Code: 107,
		Text: "Wrong password",
	}
	errAccountDisabled = &errAPI{
		Code: 103,
		Text: "Account is disabled",
	}
	errUserNotFound = &errAPI{
		Code: 101,
		Text: "User not found",
	}
	errTokenExpired = &errAPI{
		Code: 201,
		Text: "Token has expired. Please login",
	}
)

// the base url can change every time the t411 api moves from provider
const (
	t411BaseURL = "https://api.t411.li"
	authAPI     = "/auth"
	// UserAgent is the user agent header used in http requests.
	// You can override it if wanted when using t411client package.
	UserAgent    = "TBotAgent"
	defaultDelay = 24 * 7 * 2 // 2 weeks
)

{'fraction_non_alphanumeric': 0.12312892322549493, 'fraction_numerical': 0.04345726702076291, 'mean_word_length': 3.371308016877637, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '3274717', 'n_tokens_mistral': 852, 'n_tokens_neox': 759, 'n_words': 241}