<commit_before>-module(etorrent).
-behaviour(application).

-include("etorrent_mnesia_table.hrl").

-export([db_initialize/0]).
-export([start/2, stop/1, start/0]).
-export([help/0, list/0]).

start() ->
    dbg:tracer(),
    application:start(crypto),
    application:start(inets),
    application:start(timer),
    application:start(sasl),
    timer:start(),
    mnesia:start(),
    db_initialize(),
    application:start(etorrent).


start(_Type, _Args) ->
    etorrent_sup:start_link().

stop(_State) ->
    ok.

db_initialize() ->
    mnesia:create_schema([node()]),
    etorrent_mnesia_init:init().

%%--------------------------------------------------------------------
%% Function: list() -> io()
%% Description: List currently active torrents.
%%--------------------------------------------------------------------
list() ->
    {atomic, A} = etorrent_torrent:all(),
    io:format("~3s ~11s ~11s ~7s~n", ["Id:", "total", "left", "Comp."]),
    lists:foreach(fun (R) ->
			  io:format("~3.B ~11.B ~11.B ~7.3f% ~n",
				    [R#torrent.id,
				     R#torrent.total,
				     R#torrent.left,
				     percent_complete(R)])
		  end, A).<commit_msg>cleanup etorrent.erl, properly provide a stop() call.<commit_after>-module(etorrent).
-behaviour(application).

-include("etorrent_mnesia_table.hrl").

-export([db_initialize/0, stop/0, start/0]).
-export([start/2, stop/1]).
-export([help/0, list/0]).

start() ->
    dbg:tracer(),
    application:start(crypto),
    application:start(inets),
    application:start(timer),
    application:start(sasl),
    timer:start(),
    mnesia:start(),
    db_initialize(),
    application:start(etorrent).


start(_Type, _Args) ->
    etorrent_sup:start_link().

stop() ->
    application:stop(etorrent).

stop(_State) ->
    ok.

db_initialize() ->
    mnesia:create_schema([node()]),
    etorrent_mnesia_init:init().

%%--------------------------------------------------------------------
%% Function: list() -> io()
%% Description: List currently active torrents.
%%--------------------------------------------------------------------
list() ->
    {atomic, A} = etorrent_torrent:all(),
    io:format("~3s ~11s ~11s ~7s~n", ["Id:", "total", "left", "Comp."]),
    lists:foreach(fun (R) ->
			  io:format("~3.B ~11.B ~11.B ~7.3f% ~n",
				    [R#torrent.id,
				     R#torrent.total,
				     R#torrent.left,
				     percent_complete(R)])
		  end, A).
{'fraction_non_alphanumeric': 0.29352818371607514, 'fraction_numerical': 0.0162839248434238, 'mean_word_length': 2.2074966532797857, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 18, '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': '799061', 'n_tokens_mistral': 861, 'n_tokens_neox': 799, 'n_words': 128}