<commit_before>package ratelimit

import (
	"io/ioutil"
	"net/http"
	"testing"
)

func TestGetRemoteIP(t *testing.T) {

	tests := []struct {
		input    map[string]string
		expected string
	}{
		{
			map[string]string{
				"X-Forwarded-For": "192.168.1.1, 192.168.1.2",
			},
			"192.168.1.1",
		},
		{
			map[string]string{
				"Real-Ip": "192.168.1.1",
			},
			"192.168.1.1",
		},
		{
			map[string]string{
				"X-Forwarded-For": "192.168.1.2,192.168.1.1",
				"Real-Ip":         "192.168.1.2",
			},
			"172.16.17.32",
		},
		{
			map[string]string{
				"X-Forwarded-For": "",
			},
			"127.0.0.1",
		},
		{
			make(map[string]string),
			"127.0.0.1",
		},
	}

	defaultClient := &http.Client{}
	var (
		req  *http.Request
		resp *http.Response
		err  error
	)
	for i, test := range tests {<commit_msg>fix typo in test :neutral_face:<commit_after>package ratelimit

import (
	"io/ioutil"
	"net/http"
	"testing"
)

func TestGetRemoteIP(t *testing.T) {

	tests := []struct {
		input    map[string]string
		expected string
	}{
		{
			map[string]string{
				"X-Forwarded-For": "192.168.1.1, 192.168.1.2",
			},
			"192.168.1.1",
		},
		{
			map[string]string{
				"X-Real-Ip": "192.168.1.1",
			},
			"192.168.1.1",
		},
		{
			map[string]string{
				"X-Forwarded-For": "192.168.1.2,192.168.1.1",
				"X-Real-Ip":       "192.168.1.2",
			},
			"192.168.1.2",
		},
		{
			map[string]string{
				"X-Forwarded-For": "",
			},
			"127.0.0.1",
		},
		{
			make(map[string]string),
			"127.0.0.1",
		},
	}

	defaultClient := &http.Client{}
	var (
		req  *http.Request
		resp *http.Response
		err  error
	)
	for i, test := range tests {
{'fraction_non_alphanumeric': 0.21389059618930548, 'fraction_numerical': 0.1038721573448064, 'mean_word_length': 2.3429158110882957, 'pattern_counts': {'":': 10, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 22, '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': '5582666', 'n_tokens_mistral': 946, 'n_tokens_neox': 741, 'n_words': 102}