<commit_before>package main

import (
	"encoding/json"
	"errors"
)

type Input struct {
	ClientID ClientID
	Input    interface{}
}

type InputFrame struct {
	Type string
	Data *json.RawMessage
}

type InputConnect struct {
	ClientName ClientName
}

type InputDisconnect struct {
}

type InputChat struct {
	Message string
}

type InputStage struct {
	StageID StageID
}

type InputJoin struct {
}

type InputLeave struct {
}

type InputAbility struct {
	AblityName   string
	ObjectUnitID UnitID
}

type InputInterrupt struct {
}

// DecodeInputFrame decodes the input frame to a Input
func DecodeInputFrame(p []byte) (interface{}, error) {
	var f InputFrame
	if err := json.Unmarshal(p, &f); err != nil {
		return nil, err
	}
	var i InputChat
	switch f.Type {
	case "Chat":<commit_msg>Check the pointer value<commit_after>package main

import (
	"encoding/json"
	"errors"
)

type Input struct {
	ClientID ClientID
	Input    interface{}
}

type InputFrame struct {
	Type string
	Data *json.RawMessage
}

type InputConnect struct {
	ClientName ClientName
}

type InputDisconnect struct {
}

type InputChat struct {
	Message string
}

type InputStage struct {
	StageID StageID
}

type InputJoin struct {
}

type InputLeave struct {
}

type InputAbility struct {
	AblityName   string
	ObjectUnitID UnitID
}

type InputInterrupt struct {
}

// DecodeInputFrame decodes the input frame to a Input
func DecodeInputFrame(p []byte) (interface{}, error) {
	var f InputFrame
	if err := json.Unmarshal(p, &f); err != nil {
		return nil, err
	}
	if f.Data == nil {
		return nil, errors.New("Input frame does not have data key")
	}
	var i InputChat
	switch f.Type {
	case "Chat":
{'fraction_non_alphanumeric': 0.08353365384615384, 'fraction_numerical': 0.0, 'mean_word_length': 3.970149253731343, 'pattern_counts': {'":': 2, '<': 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': '578624', 'n_tokens_mistral': 556, 'n_tokens_neox': 550, 'n_words': 184}