<commit_before>package selenoid

import (
	"archive/tar"
	"archive/zip"
	"bufio"
	"bytes"
	"compress/gzip"
	"context"
	"encoding/hex"
	"encoding/json"
	"fmt"
	"github.com/aerokube/selenoid/config"
	"github.com/fatih/color"
	"github.com/google/go-github/github"
	"github.com/mitchellh/go-ps"
	"gopkg.in/cheggaaa/pb.v1"
	"io"
	"io/ioutil"
	"net/http"
	"net/url"
	"os"
	"os/exec"
	"path/filepath"
	"regexp"
	"runtime"
	"strings"
)

const (
	zipMagicHeader  = "504b"
	gzipMagicHeader = "1f8b"
	owner           = "aerokube"
	selenoidRepo    = "selenoid"
	selenoidUIRepo  = "selenoid-ui"
)

type Browsers map[string]Browser

type Browser struct {
	Command string `json:"command"`
	Files   Files  `json:"files"`
}

type Files map[string]Architectures

type Architectures map[string]Driver

type Driver struct {
	URL      string `json:"url"`
	Filename string `json:"filename"`
}

type downloadedDriver struct {
	BrowserName string
	Command     []string
}

type DriversConfigurator struct {
	Logger
	ConfigDirAware
	VersionAware
	DownloadAware
	ArgsAware
	EnvAware
	BrowserEnvAware
	PortAware
	RequestedBrowsersAware
	LogsAware
	Browsers       string
	DriversInfoUrl string

	GithubBaseUrl string
	OS            string
	Arch          string
}

func NewDriversConfigurator(config *LifecycleConfig) *DriversConfigurator {
	return &DriversConfigurator{
		Logger:                 Logger{Quiet: config.Quiet},
		ConfigDirAware:         ConfigDirAware{ConfigDir: config.ConfigDir},
		VersionAware:           VersionAware{Version: config.Version},
		ArgsAware:              ArgsAware{Args: config.Args},
		EnvAware:               EnvAware{Env: config.Env},
		BrowserEnvAware:        BrowserEnvAware{BrowserEnv: config.BrowserEnv},
		PortAware:              PortAware{Port: config.Port},
		DownloadAware:          DownloadAware{DownloadNeeded: config.Download},
		RequestedBrowsersAware: RequestedBrowsersAware{Browsers: config.Browsers},
		LogsAware:              LogsAware{DisableLogs: config.DisableLogs},
		DriversInfoUrl:         config.DriversInfoUrl,
		Browsers:               config.Browsers,
		GithubBaseUrl:          config.GithubBaseUrl,
		OS:                     config.OS,
		Arch:                   config.Arch,
	}
}

func (d *DriversConfigurator) Status() {
	binaryPath := d.getSelenoidBinaryPath()
	if fileExists(binaryPath) {
		d.Pointf("Selenoid binary is %s", binaryPath)
	} else {<commit_msg>Removed useless fields from struct<commit_after>package selenoid

import (
	"archive/tar"
	"archive/zip"
	"bufio"
	"bytes"
	"compress/gzip"
	"context"
	"encoding/hex"
	"encoding/json"
	"fmt"
	"github.com/aerokube/selenoid/config"
	"github.com/fatih/color"
	"github.com/google/go-github/github"
	"github.com/mitchellh/go-ps"
	"gopkg.in/cheggaaa/pb.v1"
	"io"
	"io/ioutil"
	"net/http"
	"net/url"
	"os"
	"os/exec"
	"path/filepath"
	"regexp"
	"runtime"
	"strings"
)

const (
	zipMagicHeader  = "504b"
	gzipMagicHeader = "1f8b"
	owner           = "aerokube"
	selenoidRepo    = "selenoid"
	selenoidUIRepo  = "selenoid-ui"
)

type Browsers map[string]Browser

type Browser struct {
	Command string `json:"command"`
	Files   Files  `json:"files"`
}

type Files map[string]Architectures

type Architectures map[string]Driver

type Driver struct {
	URL      string `json:"url"`
	Filename string `json:"filename"`
}

type downloadedDriver struct {
	BrowserName string
	Command     []string
}

type DriversConfigurator struct {
	Logger
	ConfigDirAware
	VersionAware
	DownloadAware
	ArgsAware
	EnvAware
	BrowserEnvAware
	PortAware
	RequestedBrowsersAware
	LogsAware
	DriversInfoUrl string

	GithubBaseUrl string
	OS            string
	Arch          string
}

func NewDriversConfigurator(config *LifecycleConfig) *DriversConfigurator {
	return &DriversConfigurator{
		Logger:                 Logger{Quiet: config.Quiet},
		ConfigDirAware:         ConfigDirAware{ConfigDir: config.ConfigDir},
		VersionAware:           VersionAware{Version: config.Version},
		ArgsAware:              ArgsAware{Args: config.Args},
		EnvAware:               EnvAware{Env: config.Env},
		BrowserEnvAware:        BrowserEnvAware{BrowserEnv: config.BrowserEnv},
		PortAware:              PortAware{Port: config.Port},
		DownloadAware:          DownloadAware{DownloadNeeded: config.Download},
		RequestedBrowsersAware: RequestedBrowsersAware{Browsers: config.Browsers},
		LogsAware:              LogsAware{DisableLogs: config.DisableLogs},
		DriversInfoUrl:         config.DriversInfoUrl,
		GithubBaseUrl:          config.GithubBaseUrl,
		OS:                     config.OS,
		Arch:                   config.Arch,
	}
}

func (d *DriversConfigurator) Status() {
	binaryPath := d.getSelenoidBinaryPath()
	if fileExists(binaryPath) {
		d.Pointf("Selenoid binary is %s", binaryPath)
	} else {
{'fraction_non_alphanumeric': 0.10225595614589922, 'fraction_numerical': 0.002530044275774826, 'mean_word_length': 3.396663577386469, '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': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3784430', 'n_tokens_mistral': 1757, 'n_tokens_neox': 1675, 'n_words': 310}