<commit_before>package ak

import (
	"encoding/json"
	"net/http"
	"path"
	"reflect"
	"strconv"
)

//定义方法类型
type actionFunc func(*Context)

//请求上下文
type Context struct {
	Request        *http.Request
	ResponseWriter http.ResponseWriter
	Params         map[string]string
	Data           map[string]interface{} //返回参数定义
	server         *Server
	Session        *Session
	status         int //http状态
	closed         bool
}

func (ctx *Context) SetStatus(status int) {
	ctx.status = status
}

//获取参数int
func (ctx *Context) ArgumentInt(name string) (int, error) {
	return strconv.Atoi(ctx.Params[name])
}
<commit_msg>add GetArg...<commit_after>package ak

import (
	"encoding/json"
	"net/http"
	"path"
	"reflect"
	"strconv"
)

//定义方法类型
type actionFunc func(*Context)

//请求上下文
type Context struct {
	Request        *http.Request
	ResponseWriter http.ResponseWriter
	Params         map[string]string
	Data           map[string]interface{} //返回参数定义
	server         *Server
	Session        *Session
	status         int //http状态
	closed         bool
}

func (ctx *Context) GetArgStr(param, def string) string {
	if v, ok := ctx.Params[param]; ok {
		return v
	} else {
		return def
	}
}

func (ctx *Context) GetArgInt(param string, def int) int {
	if v, ok := ctx.Params[param]; ok {
		i, err := strconv.Atoi(v)
		if err != nil {
			return def
		}
		return i
	} else {
		return def
	}
}

func (ctx *Context) IsArgExists(param string) bool {
	_, ok := ctx.Params[param]
	return ok
}

func (ctx *Context) SetStatus(status int) {
	ctx.status = status
}

//获取参数int
func (ctx *Context) ArgumentInt(name string) (int, error) {
	return strconv.Atoi(ctx.Params[name])
}

{'fraction_non_alphanumeric': 0.12121212121212122, 'fraction_numerical': 0.0, 'mean_word_length': 2.949760765550239, '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': '5465863', 'n_tokens_mistral': 611, 'n_tokens_neox': 609, 'n_words': 156}