<commit_before>/* Copyright (c) 2014-2015, <NAME> <<EMAIL>> */
/* See LICENSE for licensing information */

package main

import (
	"flag"
	"fmt"
	"log"
	"net/http"
)

var (
	listen = flag.String("l", ":8080", "Host and port to listen to")
)

type httpHandler struct {
	Clubs []CommunityClub
}

func (h httpHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
	switch r.Method {
	case "GET":
		h.handleGet(w, r)
	case "POST":
		h.handlePost(w, r)
	default:
		http.Error(w, "unsupported action", http.StatusBadRequest)
	}
}

func (h *httpHandler) handleGet(w http.ResponseWriter, r *http.Request) {
	fmt.Fprintf(w, "GET")
}

func (h *httpHandler) handlePost(w http.ResponseWriter, r *http.Request) {
	fmt.Fprintf(w, "POST")
}

func main() {
	flag.Parse()<commit_msg>Open endpoint<commit_after>/* Copyright (c) 2014-2015, <NAME> <<EMAIL>> */
/* See LICENSE for licensing information */

package main

import (
	"encoding/json"
	"flag"
	"fmt"
	"log"
	"net/http"
	"strings"
)

var (
	listen = flag.String("l", ":8080", "Host and port to listen to")
)

type httpHandler struct {
	Clubs []CommunityClub
}

func (h httpHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
	switch r.Method {
	case "GET":
		h.handleGet(w, r)
	case "POST":
		h.handlePost(w, r)
	default:
		http.Error(w, "unsupported action", http.StatusBadRequest)
	}
}

func (h *httpHandler) handleGet(w http.ResponseWriter, r *http.Request) {
	switch strings.ToLower(r.URL.Path) {
	case "/clubs":
		e := json.NewEncoder(w)
		e.Encode(&h.Clubs)
	default:
		http.Error(w, "unknown endpoint", http.StatusBadRequest)
	}
}

func (h *httpHandler) handlePost(w http.ResponseWriter, r *http.Request) {
	fmt.Fprintf(w, "POST")
}

func main() {
	flag.Parse()
{'fraction_non_alphanumeric': 0.16415313225058004, 'fraction_numerical': 0.013921113689095127, 'mean_word_length': 4.340557275541796, 'pattern_counts': {'":': 7, '<': 9, '<?xml version=': 0, '>': 9, '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': '5232910', 'n_tokens_mistral': 693, 'n_tokens_neox': 652, 'n_words': 164}