<commit_before>#include <stdio.h>
#include <pthread.h>
#include "lua.h"
#include "lualib.h"
#include "lauxlib.h"
#include "rava.h"

LUA_API int luaopen_rava_fs(lua_State *L);
LUA_API int luaopen_rava_process(lua_State *L);
LUA_API int luaopen_rava_socket(lua_State *L);
LUA_API int luaopen_rava_system(lua_State *L);

/**
 * Create a lua container from and run the lua code you pass to it
 *
 * returns new lua state
 */
lua_State* rava_newlua() {
	int i;

	lua_State* L = luaL_newstate();

	if (!L) {
		printf("Error: LuaJIT unavailable!!\n");
	}

	// stop collector during initialization
	lua_gc(L, LUA_GCSTOP, 0);
	// open libraries
	luaL_openlibs(L);<commit_msg>added return null on Lua load error<commit_after>#include <stdio.h>
#include <pthread.h>
#include "lua.h"
#include "lualib.h"
#include "lauxlib.h"
#include "rava.h"

LUA_API int luaopen_rava_fs(lua_State *L);
LUA_API int luaopen_rava_process(lua_State *L);
LUA_API int luaopen_rava_socket(lua_State *L);
LUA_API int luaopen_rava_system(lua_State *L);

/**
 * Create a lua container from and run the lua code you pass to it
 *
 * returns new lua state
 */
lua_State* rava_newlua() {
	int i;

	lua_State* L = luaL_newstate();

	if (!L) {
		printf("Error: LuaJIT unavailable!!\n");

		return NULL;
	}

	// stop collector during initialization
	lua_gc(L, LUA_GCSTOP, 0);
	// open libraries
	luaL_openlibs(L);
{'fraction_non_alphanumeric': 0.12773722627737227, 'fraction_numerical': 0.00145985401459854, 'mean_word_length': 4.9094827586206895, 'pattern_counts': {'":': 0, '<': 7, '<?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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5670257', 'n_tokens_mistral': 579, 'n_tokens_neox': 542, 'n_words': 143}