<commit_before>#
#  The OpenDiamond Platform for Interactive Search
#  Version 4
#
#  Copyright (c) 2009 Carnegie Mellon University
#  All rights reserved.
#
#  This software is distributed under the terms of the Eclipse Public
#  License, Version 1.0 which can be found in the file named LICENSE.
#  ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS SOFTWARE CONSTITUTES
#  RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT
#

from subprocess import Popen, PIPE

def _GenerateCookie(scopelist, servers):
    cmd = ["cookiecutter"]
    for server in servers:
	cmd.extend(['-s', server])
    for url in scopelist:
	cmd.extend(['-u', url])
    return Popen(cmd, stdout=PIPE).stdout.read()

def GenerateCookie(scopelist, servers, proxies=None):
    if not proxies:
	return _GenerateCookie(scopelist, servers)
    cookie = []
    n = len(proxies)
    for i in range(n):
	scope = [ '/proxy/%dof%d/%s:5873%s' % (i+1, n, server, scope)
		  for scope in scopelist for server in servers ]
	cookie.append(_GenerateCookie(scope, (proxies[i],)))
    return ''.join(cookie)
<commit_msg>Remove Python wrapper function for executing cookiecutter program<commit_after>#
#  The OpenDiamond Platform for Interactive Search
#  Version 4
#
#  Copyright (c) 2009 Carnegie Mellon University
#  All rights reserved.
#
#  This software is distributed under the terms of the Eclipse Public
#  License, Version 1.0 which can be found in the file named LICENSE.
#  ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS SOFTWARE CONSTITUTES
#  RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT
#

{'fraction_non_alphanumeric': 0.09037711313394019, 'fraction_numerical': 0.01235370611183355, 'mean_word_length': 4.325259515570934, 'pattern_counts': {'":': 0, '<': 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': '6519284', 'n_tokens_mistral': 517, 'n_tokens_neox': 476, 'n_words': 177}