<commit_before>
#include "condor_common.h"
#include "condor_config.h"
#include "condor_distribution.h"

#include "time.h"

#include "dc_cached.h"

int
main(int argc, char * argv[])
{
	myDistro->Init( argc, argv );
	config();
	dprintf_set_tool_debug("TOOL", 0);

	DCCached client;
	CondorError err;
	std::string cacheName = "/tester";
	time_t expiry = time(NULL) + 86400;
	int rc = client.createCacheDir(cacheName, expiry, err);
	if (rc) {
		fprintf(stderr, "FAIL: Return code from createCacheDir: %d\nError contents: %s\n", rc, err.getFullText().c_str());
	} else {
		fprintf(stdout, "SUCCESS: Initial creation of cache successful\n");
	}

	std::list<std::string> files;
	files.push_front("/etc/hosts");
	rc = client.uploadFiles(cacheName, files, err);
	if (rc) {
		fprintf(stderr, "FAIL: Return code from uploadFiles: %d\nError contents: %s\n", rc, err.getFullText().c_str());
		return 1;
	} else {
		fprintf(stdout, "SUCCESS: Initial upload of file successful\n");
	}

	// Attempt to upload the files again, should be an error:
	rc = client.uploadFiles(cacheName, files, err);
	if (rc) {
		fprintf(stderr, "SUCCESS: Return code from uploadFiles: %d\nError contents: %s\n", rc, err.getFullText().c_str());
	} else {
		fprintf(stdout, "FAIL: Second upload of file successful, it shouldn't be...\n");
		return 1;
	}


	char destination[PATH_MAX];
	getcwd(destination, PATH_MAX);
	rc = client.downloadFiles(cacheName, destination, err);
	if (rc) {
		fprintf(stderr, "FAIL: Return code from downloadFiles: %d\nError contents: %s\n", rc, err.getFullText().c_str());
		return 1;
	} else {
		fprintf(stdout, "SUCCESS: Download of files successful\n");
	}
	
	// Remove the cache directory
	/*rc = client.removeCacheDir(cacheName, err);
	if (rc) {
		fprintf(stderr, "FAIL: Return code from removeCacheDir: %d\nError contents: %s\n", rc, err.getFullText().c_str());
		return 1;
	} else {
		fprintf(stdout, "SUCCESS: Removal of Cache\n");
	}
	*/
	return 0;
}<commit_msg>Adding replication to tester<commit_after>
#include "condor_common.h"
#include "condor_config.h"
#include "condor_distribution.h"

#include "time.h"

#include "dc_cached.h"

int
main(int argc, char * argv[])
{
	myDistro->Init( argc, argv );
	config();
	dprintf_set_tool_debug("TOOL", 0);

	DCCached client;
	CondorError err;
	std::string cacheName = "/tester";
	time_t expiry = time(NULL) + 86400;
	int rc = client.createCacheDir(cacheName, expiry, err);
	if (rc) {
		fprintf(stderr, "FAIL: Return code from createCacheDir: %d\nError contents: %s\n", rc, err.getFullText().c_str());
	} else {
		fprintf(stdout, "SUCCESS: Initial creation of cache successful\n");
	}

	std::list<std::string> files;
	files.push_front("/etc/hosts");
	rc = client.uploadFiles(cacheName, files, err);
	if (rc) {
		fprintf(stderr, "FAIL: Return code from uploadFiles: %d\nError contents: %s\n", rc, err.getFullText().c_str());
		return 1;
	} else {
		fprintf(stdout, "SUCCESS: Initial upload of file successful\n");
	}

	// Attempt to upload the files again, should be an error:
	rc = client.uploadFiles(cacheName, files, err);
	if (rc) {
		fprintf(stderr, "SUCCESS: Return code from uploadFiles: %d\nError contents: %s\n", rc, err.getFullText().c_str());
	} else {
		fprintf(stdout, "FAIL: Second upload of file successful, it shouldn't be...\n");
		return 1;
	}
	
	// Set the replication policy
	std::string policy = "TRUE";
	rc = client.setReplicationPolicy(cacheName, policy, err);
	if (rc) {
		fprintf(stderr, "FAIL: Return code from setReplicationPolicy: %d\nError contents: %s\n", rc, err.getFullText().c_str());
	} else {
		fprintf(stdout, "SUCCESS: setReplicationPolicy was successful\n");
		return 1;
	}


	char destination[PATH_MAX];
	getcwd(destination, PATH_MAX);
	rc = client.downloadFiles(cacheName, destination, err);
	if (rc) {
		fprintf(stderr, "FAIL: Return code from downloadFiles: %d\nError contents: %s\n", rc, err.getFullText().c_str());
		return 1;
	} else {
		fprintf(stdout, "SUCCESS: Download of files successful\n");
	}
	

	
	// Remove the cache directory
	/*rc = client.removeCacheDir(cacheName, err);
	if (rc) {
		fprintf(stderr, "FAIL: Return code from removeCacheDir: %d\nError contents: %s\n", rc, err.getFullText().c_str());
		return 1;
	} else {
		fprintf(stdout, "SUCCESS: Removal of Cache\n");
	}
	*/
	return 0;
}
{'fraction_non_alphanumeric': 0.15694962686567165, 'fraction_numerical': 0.005363805970149254, 'mean_word_length': 4.658311345646438, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1084616', 'n_tokens_mistral': 1589, 'n_tokens_neox': 1520, 'n_words': 413}