<commit_before>package pes

import "errors"
import "io"
import "io/ioutil"
import "github.com/32bitkid/mpeg/util"
import "github.com/32bitkid/mpeg/ts"

const (
	StartCodePrefix = 0x000001
)

var (
	ErrStartCodePrefixNotFound = errors.New("start code prefix not found")
	ErrMarkerNotFound          = errors.New("marker not found")
	ErrInvalidStuffingByte     = errors.New("invalid stuffing byte")
)

type Packet struct {
	StreamID     uint32
	PacketLength uint32
	*Header
	Payload []byte
}

func ReadPacketFrom(br util.BitReader32) (packet *Packet, err error) {
	packet = new(Packet)
	err = packet.readFrom(br)
	return packet, err
}

func (packet *Packet) readFrom(reader util.BitReader32) error {

	var (
		val uint32
		err error
	)<commit_msg>Still toying with naming.<commit_after>package pes

import "errors"
import "io"
import "io/ioutil"
import "github.com/32bitkid/mpeg/util"
import "github.com/32bitkid/mpeg/ts"

const (
	StartCodePrefix = 0x000001
)

var (
	ErrStartCodePrefixNotFound = errors.New("start code prefix not found")
	ErrMarkerNotFound          = errors.New("marker not found")
	ErrInvalidStuffingByte     = errors.New("invalid stuffing byte")
)

type Packet struct {
	StreamID     uint32
	PacketLength uint32
	*Header
	Payload []byte
}

func NewPacket(br util.BitReader32) (packet *Packet, err error) {
	packet = new(Packet)
	err = packet.readFrom(br)
	return packet, err
}

func (packet *Packet) readFrom(reader util.BitReader32) error {

	var (
		val uint32
		err error
	)
{'fraction_non_alphanumeric': 0.10234113712374582, 'fraction_numerical': 0.028093645484949834, 'mean_word_length': 4.362007168458781, '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': '1916778', 'n_tokens_mistral': 546, 'n_tokens_neox': 504, 'n_words': 133}