<commit_before>package radio

type Packet struct {
	Rssi int
	Data []byte
}

type Counters struct {
	Received int
	Sent     int
}

type Statistics struct {
	Bytes   Counters
	Packets Counters
}

type Interface interface {
	Init() error

	Frequency() (uint32, error)
	SetFrequency(uint32) error

	Incoming() <-chan Packet
	Outgoing() chan<- Packet

	State() string
	Statistics() Statistics
}<commit_msg>Simpler API<commit_after>package radio

import (
	"fmt"
	"time"
)

type Counters struct {
	Sent     int
	Received int
}

type Statistics struct {
	Bytes   Counters
	Packets Counters
}

type Interface interface {
	Init(frequency uint32)

	Frequency() uint32
	SetFrequency(uint32)

	Send([]byte)
	Receive(time.Duration) ([]byte, int)

	State() string
	Statistics() Statistics

	Error() error
	SetError(error)
}

func MegaHertz(freq uint32) string {
	MHz := freq / 1000000
	kHz := (freq % 1000000) / 1000
	return fmt.Sprintf("%3d.%03d", MHz, kHz)
}
{'fraction_non_alphanumeric': 0.10348468848996832, 'fraction_numerical': 0.03484688489968321, 'mean_word_length': 4.124324324324324, 'pattern_counts': {'":': 0, '<': 5, '<?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': '5943838', 'n_tokens_mistral': 367, 'n_tokens_neox': 315, 'n_words': 97}