<commit_before>import subprocess
import sys


SOURCE_VERSION = "2.0"
INCREMENTS = {
	"patch": 2,
	"minor": 1,
	"major": 0,
}

def main():
	increment = sys.argv[-1]
	if increment not in ['patch', 'minor', 'major']:
		print 'Invalid INCREMENT value. Please use "patch", "minor", or "major".'
		os.Exit(1)

	increment = INCREMENTS[increment] 

	prefix = SOURCE_VERSION + "."
	current = subprocess.check_output("git describe", shell=True)
	last_stable = subprocess.check_output("git tag -l", shell=True).strip().split('\n')[-1]
	if current == last_stable:
		return

	last_stable_split = last_stable.split('.')
	last_stable_split[increment] = str(int(last_stable_split[increment]) + 1)
	
	if increment == 0:
		last_stable_split[1] = "0"
		last_stable_split[2] = "0"

	if increment == 1:
		last_stable_split[2] = "0"

	incremented = '.'.join(last_stable_split)
	print incremented

	replace_in_file('Sources/Info.plist', last_stable, incremented)
	replace_in_file('SmartystreetsSDK.podspec', last_stable, incremented)

	subprocess.check_call('git add Sources/Info.plist SmartystreetsSDK.podspec', shell=True)
	subprocess.check_call('git commit -m "Incremented version number to {0}"'.format(incremented), shell=True)
	subprocess.check_call('git tag -a {0} -m ""'.format(incremented), shell=True)
	subprocess.check_call('git push origin master --tags', shell=True)


def replace_in_file(filename, search, replace):
	with open(filename) as source:
		updated = source.read().replace(search, replace)
<commit_msg>Providing a message in the git tag<commit_after>import subprocess
import sys


SOURCE_VERSION = "2.0"
INCREMENTS = {
	"patch": 2,
	"minor": 1,
	"major": 0,
}

def main():
	increment = sys.argv[-1]
	if increment not in ['patch', 'minor', 'major']:
		print 'Invalid INCREMENT value. Please use "patch", "minor", or "major".'
		os.Exit(1)

	increment = INCREMENTS[increment] 

	prefix = SOURCE_VERSION + "."
	current = subprocess.check_output("git describe", shell=True)
	last_stable = subprocess.check_output("git tag -l", shell=True).strip().split('\n')[-1]
	if current == last_stable:
		return

	last_stable_split = last_stable.split('.')
	last_stable_split[increment] = str(int(last_stable_split[increment]) + 1)
	
	if increment == 0:
		last_stable_split[1] = "0"
		last_stable_split[2] = "0"

	if increment == 1:
		last_stable_split[2] = "0"

	incremented = '.'.join(last_stable_split)
	print incremented

	replace_in_file('Sources/Info.plist', last_stable, incremented)
	replace_in_file('SmartystreetsSDK.podspec', last_stable, incremented)

	subprocess.check_call('git add Sources/Info.plist SmartystreetsSDK.podspec', shell=True)
	subprocess.check_call('git commit -m "Incremented version number to {0}"'.format(incremented), shell=True)
	subprocess.check_call('git tag -a {0} -m "{0}"'.format(incremented), shell=True)
	subprocess.check_call('git push origin master --tags', shell=True)


def replace_in_file(filename, search, replace):
	with open(filename) as source:
		updated = source.read().replace(search, replace)

{'fraction_non_alphanumeric': 0.14729194187582562, 'fraction_numerical': 0.012879788639365918, 'mean_word_length': 5.542116630669547, 'pattern_counts': {'":': 6, '<': 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': '3235646', 'n_tokens_mistral': 1122, 'n_tokens_neox': 1047, 'n_words': 240}