<commit_before>// Copyright (c) 2016-2017 <NAME>. All rights reserved.
// Use of this source code is governed by the MIT license
// that can be found in the LICENSE file.

// Package weatherlink implements the Davis Instruments serial, USB, and
// TCP/IP communication protocol.
package weatherlink

import (
	"bytes"
	"encoding/hex"
	"errors"
	"strings"
	"time"
)

const (
	cr  = 0x0d // Carriage return
	lf  = 0x0a // Line Feed
	ack = 0x06 // Acknowledge
	esc = 0x18 // Escape
	nak = 0x21 // Not acknowledge
)

type cmd uint8

// Commands that can be requested.
const (
	GetDmps cmd = iota
	GetEEPROM
	GetHiLows
	GetLoops
	LampsOff
	LampsOn
	Stop
	SyncConsTime
)

// Errors.
var (
	ErrBadCRC      = errors.New("CRC check failed")
	ErrBadLocation = errors.New("Location is inconsistent")
	ErrNotDmp      = errors.New("Not a DMP metadata packet")
	ErrNotDmpB     = errors.New("Not a revision B DMP packet")
	ErrNotLoop     = errors.New("Not a loop packet")
	ErrUnknownLoop = errors.New("Loop packet type is unknown")
	ErrCmdFailed   = errors.New("Protocol command failed")
)

// Tunables.
var (<commit_msg>Reorder constants<commit_after>// Copyright (c) 2016-2017 <NAME>. All rights reserved.
// Use of this source code is governed by the MIT license
// that can be found in the LICENSE file.

// Package weatherlink implements the Davis Instruments serial, USB, and
// TCP/IP communication protocol.
package weatherlink

import (
	"bytes"
	"encoding/hex"
	"errors"
	"strings"
	"time"
)

const (
	cr  = 0x0d // Carriage return
	lf  = 0x0a // Line Feed
	ack = 0x06 // Acknowledge
	nak = 0x21 // Not acknowledge
	esc = 0x18 // Escape
)

type cmd uint8

// Commands that can be requested.
const (
	GetDmps cmd = iota
	GetEEPROM
	GetHiLows
	GetLoops
	LampsOff
	LampsOn
	Stop
	SyncConsTime
)

// Errors.
var (
	ErrBadCRC      = errors.New("CRC check failed")
	ErrBadLocation = errors.New("Location is inconsistent")
	ErrNotDmp      = errors.New("Not a DMP metadata packet")
	ErrNotDmpB     = errors.New("Not a revision B DMP packet")
	ErrNotLoop     = errors.New("Not a loop packet")
	ErrUnknownLoop = errors.New("Loop packet type is unknown")
	ErrCmdFailed   = errors.New("Protocol command failed")
)

// Tunables.
var (
{'fraction_non_alphanumeric': 0.10108303249097472, 'fraction_numerical': 0.019855595667870037, 'mean_word_length': 3.330078125, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '6361859', 'n_tokens_mistral': 789, 'n_tokens_neox': 741, 'n_words': 251}