<commit_before>package main

import (
	"fmt"
	"github.com/op/go-logging"
	"os"
	"os/exec"
	"strings"
)

var log = logging.MustGetLogger("git-grab")

func main() {
	home := os.Getenv("HOME")
	usage := `Usage: 
  git grab <repository>`

	args := os.Args[1:] // get cmdline args without program
	if len(args) < 1 {
		fmt.Println(usage)
		os.Exit(1)
	}

	repoPath := ParseRepo(args[0])
	var cloneDir string = fmt.Sprintf("%s/Projects-test/%s", home, repoPath)
	cmd := exec.Command("git", "clone", args[0], cloneDir)
	cmd.Stdout = os.Stdout
	cmd.Stderr = os.Stderr
	err := cmd.Run()
	if err != nil {
		log.Fatal(err)
	}
}

// Parses the git repository path and determines the folder location on
// local file system
func ParseRepo(repo string) string {
	var server string = ""
	var owner string = ""
	var repoName string = ""

	var noProtocol = strings.Split(repo, "://")
	var withoutGit = strings.Split(noProtocol[len(noProtocol)-1], "@")
	var basicRepo string = withoutGit[len(withoutGit)-1]
	basicRepo = strings.Replace(basicRepo, ".git", "", 1)
	var ownerRepoSplit = strings.Split(basicRepo, "/")

	server = strings.Split(basicRepo, ".")[0]
	owner = ownerRepoSplit[len(ownerRepoSplit)-2]
	var colonSplit = strings.Split(owner, ":")
	owner = colonSplit[len(colonSplit)-1]
	owner = strings.Replace(owner, "~", "users/", 1)
	owner = strings.ToLower(owner)
	repoName = ownerRepoSplit[len(ownerRepoSplit)-1]

	return fmt.Sprintf("%s/%s/%s", server, owner, repoName)
}
<commit_msg>change the project directory name<commit_after>package main

import (
	"fmt"
	"github.com/op/go-logging"
	"os"
	"os/exec"
	"strings"
)

var log = logging.MustGetLogger("git-grab")

func main() {
	home := os.Getenv("HOME")
	usage := `Usage: 
  git grab <repository>`

	args := os.Args[1:] // get cmdline args without program
	if len(args) < 1 {
		fmt.Println(usage)
		os.Exit(1)
	}

	repoPath := ParseRepo(args[0])
	var cloneDir string = fmt.Sprintf("%s/Projects/%s", home, repoPath)
	cmd := exec.Command("git", "clone", args[0], cloneDir)
	cmd.Stdout = os.Stdout
	cmd.Stderr = os.Stderr
	err := cmd.Run()
	if err != nil {
		log.Fatal(err)
	}
}

// Parses the git repository path and determines the folder location on
// local file system
func ParseRepo(repo string) string {
	var server string = ""
	var owner string = ""
	var repoName string = ""

	var noProtocol = strings.Split(repo, "://")
	var withoutGit = strings.Split(noProtocol[len(noProtocol)-1], "@")
	var basicRepo string = withoutGit[len(withoutGit)-1]
	basicRepo = strings.Replace(basicRepo, ".git", "", 1)
	var ownerRepoSplit = strings.Split(basicRepo, "/")

	server = strings.Split(basicRepo, ".")[0]
	owner = ownerRepoSplit[len(ownerRepoSplit)-2]
	var colonSplit = strings.Split(owner, ":")
	owner = colonSplit[len(colonSplit)-1]
	owner = strings.Replace(owner, "~", "users/", 1)
	owner = strings.ToLower(owner)
	repoName = ownerRepoSplit[len(ownerRepoSplit)-1]

	return fmt.Sprintf("%s/%s/%s", server, owner, repoName)
}

{'fraction_non_alphanumeric': 0.16638542018224772, 'fraction_numerical': 0.008774890313871077, 'mean_word_length': 4.389090909090909, 'pattern_counts': {'":': 4, '<': 7, '<?xml version=': 0, '>': 5, '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': '3092038', 'n_tokens_mistral': 1083, 'n_tokens_neox': 1066, 'n_words': 248}