<commit_before>#include "filter.h"
#include "logging.h"

void Filter::Update()
{	
	if(image1 != NULL)
	{
		char msg[128];
		sprintf(msg,"%s: about to update input1\n", SinkName() );
		Logger::LogEvent(msg);
		image1->Update();
		sprintf(msg,"%s: done updating input1\n", SinkName() );
		Logger::LogEvent(msg);
		sprintf(msg,"%s: about to execute\n", SinkName() );
		Logger::LogEvent(msg);
		sprintf(msg,"%s: done executing\n", SinkName() );
		Logger::LogEvent(msg);
	}

	if(image2 != NULL)
	{
		char msg[128];
		sprintf(msg,"%s: about to update input2\n", SinkName());
		Logger::LogEvent(msg);
		image2->Update();
		sprintf(msg,"%s: done to update input2\n", SinkName());
		Logger::LogEvent(msg);
		sprintf(msg,"%s: about to execute\n", SinkName() );
		Logger::LogEvent(msg);<commit_msg>add exceptions<commit_after>#include "filter.h"
#include "logging.h"

int sumException;

void Filter::Update()
{	
	sumException++;

	if(sumException > 1000)
	{
		char msg[1024];
		sprintf(msg, "%s: greater than 1000\n", SinkName());
		DataFlowException e(SinkName(), msg);
		throw e;
	}
	
	if(image1 != NULL)
	{
		char msg[128];
		sprintf(msg,"%s: about to update input1\n", SinkName() );
		Logger::LogEvent(msg);
		image1->Update();
		sprintf(msg,"%s: done updating input1\n", SinkName() );
		Logger::LogEvent(msg);
		sprintf(msg,"%s: about to execute\n", SinkName() );
		Logger::LogEvent(msg);
		sprintf(msg,"%s: done executing\n", SinkName() );
		Logger::LogEvent(msg);
	}

	if(image2 != NULL)
	{
		char msg[128];
		sprintf(msg,"%s: about to update input2\n", SinkName());
		Logger::LogEvent(msg);
		image2->Update();
		sprintf(msg,"%s: done to update input2\n", SinkName());
		Logger::LogEvent(msg);
		sprintf(msg,"%s: about to execute\n", SinkName() );
		Logger::LogEvent(msg);
{'fraction_non_alphanumeric': 0.2006783493499152, 'fraction_numerical': 0.022611644997173545, 'mean_word_length': 5.103448275862069, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, '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': '7096656', 'n_tokens_mistral': 727, 'n_tokens_neox': 676, 'n_words': 138}