<commit_before># repo.py
# Copyright (C) 2008, 2009 <NAME> (<EMAIL>) and contributors
#
# This module is part of GitPython and is released under
# the BSD License: http://www.opensource.org/licenses/bsd-license.php

import os
import sys
import re
import gzip
import StringIO

from errors import InvalidGitRepositoryError, NoSuchPathError
from cmd import Git
from actor import Actor
from refs import *
from objects import *
from config import GitConfigParser
from remote import Remote

def touch(filename):
	fp = open(filename, "w")
	fp.close()

def is_git_dir(d):
	""" This is taken from the git setup.c:is_git_directory
		function."""

	if os.path.isdir(d) and \
			os.path.isdir(os.path.join(d, 'objects')) and \
			os.path.isdir(os.path.join(d, 'refs')):
		headref = os.path.join(d, 'HEAD')
		return os.path.isfile(headref) or \
				(os.path.islink(headref) and
				os.readlink(headref).startswith('refs'))
	return False
<commit_msg>touch method improved to open for appending which would not clear the file and be like an actual touch<commit_after># repo.py
# Copyright (C) 2008, 2009 <NAME> (<EMAIL>) and contributors
#
# This module is part of GitPython and is released under
# the BSD License: http://www.opensource.org/licenses/bsd-license.php

import os
import sys
import re
import gzip
import StringIO

from errors import InvalidGitRepositoryError, NoSuchPathError
from cmd import Git
from actor import Actor
from refs import *
from objects import *
from config import GitConfigParser
from remote import Remote

def touch(filename):
	fp = open(filename, "a")
	fp.close()

def is_git_dir(d):
	""" This is taken from the git setup.c:is_git_directory
		function."""

	if os.path.isdir(d) and \
			os.path.isdir(os.path.join(d, 'objects')) and \
			os.path.isdir(os.path.join(d, 'refs')):
		headref = os.path.join(d, 'HEAD')
		return os.path.isfile(headref) or \
				(os.path.islink(headref) and
				os.readlink(headref).startswith('refs'))
	return False

{'fraction_non_alphanumeric': 0.11320754716981132, 'fraction_numerical': 0.00815910249872514, 'mean_word_length': 4.434903047091413, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '7080954', 'n_tokens_mistral': 702, 'n_tokens_neox': 643, 'n_words': 210}