<commit_before>/*******************************************************************************
FILE : activation_summary.c

LAST MODIFIED : 17 December 2002

DESCRIPTION :
Writes out a summary of the activation in a signal file.
==============================================================================*/
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <ctype.h>
#include <math.h>
#include "general/debug.h"
#include "unemap/analysis.h"
#include "user_interface/message.h"

int main(int argc,char *argv[])
{
	char calculate_events;
	enum Datum_type datum_type;
	enum Edit_order edit_order;
	enum Event_detection_algorithm detection;
	enum Signal_order signal_order;
	FILE *output_file;
	float activation_width,frequency,level;
	int analysis_information,arg_number,average_width,datum,end_search_interval,
		event_number,i,j,k,minimum_separation,number_of_devices,number_of_events,
		number_of_regions,number_of_samples,potential_time,return_code,
		start_search_interval,*summary_time,threshold,*time;
	short int *short_value;
	struct Device **device;
	struct Event *event;
	struct Region_list_item *region_item;
	struct Rig *signal_rig,*summary_rig;
	struct Signal_buffer *buffer,*summary_buffer;

	/* check arguments */
	return_code=0;
	if ((4==argc)||(5==argc))
	{
		arg_number=0;
		/* read the signal file */
		signal_rig=(struct Rig *)NULL;
		arg_number++;
		if (analysis_read_signal_file(argv[arg_number],&signal_rig,
			&analysis_information,&datum,&calculate_events,&detection,&event_number,
			&number_of_events,&potential_time,&minimum_separation,&threshold,
			&datum_type,&edit_order,&signal_order,&start_search_interval,
			&end_search_interval,&level,&average_width
#if defined (UNEMAP_USE_3D)
			,(struct Unemap_package *)NULL;
#endif /* defined (UNEMAP_USE_NODES) */
			))
		{
			device=signal_rig->devices;
			if (device&&(*device)&&((*device)->signal)&&
				(buffer=(*device)->signal->buffer)&&((*device)->channel))
			{
				number_of_regions=signal_rig->number_of_regions;
				frequency=buffer->frequency;
				number_of_devices=signal_rig->number_of_devices;
				number_of_samples=buffer->number_of_samples;
				/* create the summary rig */
				if ((summary_buffer=create_Signal_buffer(SHORT_INT_VALUE,
					number_of_regions,number_of_samples,frequency))&&
					(summary_rig=create_standard_Rig("summary",PATCH,MONITORING_OFF,
					EXPERIMENT_OFF,1,&number_of_regions,1,0,(float)1)))
				{
					/* fill in the devices and signals */
					return_code=1;
					device=summary_rig->devices;
					region_item=signal_rig->region_list;
					i=0;
					while (return_code&&(i<number_of_regions))
					{
						if (ALLOCATE((*device)->description->name,char,
							strlen(region_item->region->name)+1))
						{
							strcpy((*device)->description->name,region_item->region->name);
							if ((*device)->signal=create_Signal(i,summary_buffer,
								REJECTED,0))
							{
								i++;
								region_item=region_item->next;
								device++;
							}
							else
							{
								printf("ERROR.  Could not create region signal");
								return_code=0;
							}<commit_msg>Added Unemap_package to some calls<commit_after>/*******************************************************************************
FILE : activation_summary.c

LAST MODIFIED : 13 May 2004

DESCRIPTION :
Writes out a summary of the activation in a signal file.
==============================================================================*/
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <ctype.h>
#include <math.h>
#include "general/debug.h"
#include "unemap/analysis.h"
#include "user_interface/message.h"

int main(int argc,char *argv[])
{
	char calculate_events;
	enum Datum_type datum_type;
	enum Edit_order edit_order;
	enum Event_detection_algorithm detection;
	enum Signal_order signal_order;
	FILE *output_file;
	float activation_width,frequency,level;
	int analysis_information,arg_number,average_width,datum,end_search_interval,
		event_number,i,j,k,minimum_separation,number_of_devices,number_of_events,
		number_of_regions,number_of_samples,potential_time,return_code,
		start_search_interval,*summary_time,threshold,*time;
	short int *short_value;
	struct Device **device;
	struct Event *event;
	struct Region_list_item *region_item;
	struct Rig *signal_rig,*summary_rig;
	struct Signal_buffer *buffer,*summary_buffer;

	/* check arguments */
	return_code=0;
	if ((4==argc)||(5==argc))
	{
		arg_number=0;
		/* read the signal file */
		signal_rig=(struct Rig *)NULL;
		arg_number++;
		if (analysis_read_signal_file(argv[arg_number],&signal_rig,
			&analysis_information,&datum,&calculate_events,&detection,&event_number,
			&number_of_events,&potential_time,&minimum_separation,&threshold,
			&datum_type,&edit_order,&signal_order,&start_search_interval,
			&end_search_interval,&level,&average_width
#if defined (UNEMAP_USE_3D)
			,(struct Unemap_package *)NULL
#endif /* defined (UNEMAP_USE_NODES) */
			))
		{
			device=signal_rig->devices;
			if (device&&(*device)&&((*device)->signal)&&
				(buffer=(*device)->signal->buffer)&&((*device)->channel))
			{
				number_of_regions=signal_rig->number_of_regions;
				frequency=buffer->frequency;
				number_of_devices=signal_rig->number_of_devices;
				number_of_samples=buffer->number_of_samples;
				/* create the summary rig */
				if ((summary_buffer=create_Signal_buffer(SHORT_INT_VALUE,
					number_of_regions,number_of_samples,frequency))&&
					(summary_rig=create_standard_Rig("summary",PATCH,MONITORING_OFF,
					EXPERIMENT_OFF,1,&number_of_regions,1,0,(float)1
#if defined (UNEMAP_USE_3D)
					,(struct Unemap_package *)NULL
#endif /* defined (UNEMAP_USE_NODES) */
					)))
				{
					/* fill in the devices and signals */
					return_code=1;
					device=summary_rig->devices;
					region_item=signal_rig->region_list;
					i=0;
					while (return_code&&(i<number_of_regions))
					{
						if (ALLOCATE((*device)->description->name,char,
							strlen(region_item->region->name)+1))
						{
							strcpy((*device)->description->name,region_item->region->name);
							if ((*device)->signal=create_Signal(i,summary_buffer,
								REJECTED,0))
							{
								i++;
								region_item=region_item->next;
								device++;
							}
							else
							{
								printf("ERROR.  Could not create region signal");
								return_code=0;
							}
{'fraction_non_alphanumeric': 0.17136186770428016, 'fraction_numerical': 0.006381322957198444, 'mean_word_length': 5.2327837051406405, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 59, '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': '7579708', 'n_tokens_mistral': 2519, 'n_tokens_neox': 2062, 'n_words': 335}