<commit_before>
// Copyright (c) 2008-2009, Regents of the University of Colorado.
// This work was supported by NASA contracts NNJ05HE10G, NNC06CB40C, and
// NNC07CB47C.


#include "cpod.h"


void set_float_resource(bionet_node_t* node, char *id, float value, struct timeval *tv){
	bionet_resource_t* resource;
	
	resource = bionet_node_get_resource_by_id(node, id);
	if (resource == NULL) {
		g_log("", G_LOG_LEVEL_ERROR, "unable to find resource %s", id);
		return;
	}

	bionet_resource_set_float(resource, value, tv);
}
<commit_msg>correctly check return value from bionet_resource_set_float() as pointed out by Prevent<commit_after>
// Copyright (c) 2008-2009, Regents of the University of Colorado.
// This work was supported by NASA contracts NNJ05HE10G, NNC06CB40C, and
// NNC07CB47C.


#include "cpod.h"


void set_float_resource(bionet_node_t* node, char *id, float value, struct timeval *tv){
	bionet_resource_t* resource;
	
	resource = bionet_node_get_resource_by_id(node, id);
	if (resource == NULL) {
		g_log("", G_LOG_LEVEL_ERROR, "unable to find resource %s", id);
		return;
	}

	if (bionet_resource_set_float(resource, value, tv)) {
	    g_log("", G_LOG_LEVEL_WARNING, "set_float_resource(): Failed to set float.");
	}
}

{'fraction_non_alphanumeric': 0.11308562197092084, 'fraction_numerical': 0.03231017770597738, 'mean_word_length': 5.133663366336633, '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': '6513440', 'n_tokens_mistral': 495, 'n_tokens_neox': 449, 'n_words': 124}