<commit_before>#|
  This file is a part of Colleen
  (c) 2013 TymoonNET/NexT http://tymoon.eu (<EMAIL>)
  Author: <NAME> <<EMAIL>>
|#

(in-package :org.tymoonnext.colleen)

(defun start-module (&rest module-names)
  (dolist (module-name module-names)
    (unless (keywordp module-name) (setf module-name (find-symbol (string-upcase module-name) "KEYWORD")))
    (let ((module (get-module module-name)))
      (assert (not (null module)) () "Module ~a not found!" module-name)
      (assert (not (active module)) () "Module ~a already started!" module-name)
      (v:info module-name "Starting...")
      (start module)
      module)))

(defun stop-module (&rest module-names)
  (dolist (module-name module-names)
    (unless (keywordp module-name) (setf module-name (find-symbol (string-upcase module-name) "KEYWORD")))
    (let ((module (get-module module-name)))
      (assert (not (null module)) () "Module ~a not found!" module-name)
      (assert (not (not (active module))) () "Module ~a already stopped!" module-name)
      (v:info module-name "Stopping...")
      (stop module)
      module)))

(defun auth-p (nick)<commit_msg>Added restarts for module start and load<commit_after>#|
  This file is a part of Colleen
  (c) 2013 TymoonNET/NexT http://tymoon.eu (<EMAIL>)
  Author: <NAME> <<EMAIL>>
|#

(in-package :org.tymoonnext.colleen)

(defun start-module (&rest module-names)
  (dolist (module-name module-names)
    (unless (keywordp module-name) (setf module-name (find-symbol (string-upcase module-name) "KEYWORD")))
    (with-simple-restart (skip "Skip starting the module.")
      (let ((module (get-module module-name)))
        (assert (not (null module)) () "Module ~a not found!" module-name)
        (with-simple-restart (force "Force starting the module.")
          (assert (not (active module)) () "Module ~a already started!" module-name))
        (v:info module-name "Starting...")
        (loop until (with-simple-restart (retry "Retry starting the module.")
                      (start module)))
        module))))

(defun stop-module (&rest module-names)
  (dolist (module-name module-names)
    (unless (keywordp module-name) (setf module-name (find-symbol (string-upcase module-name) "KEYWORD")))
    (with-simple-restart (skip "Skip stopping the module.")
      (let ((module (get-module module-name)))
        (assert (not (null module)) () "Module ~a not found!" module-name)
        (with-simple-restart (force "Force stopping the module.")
          (assert (not (not (active module))) () "Module ~a already stopped!" module-name))
        (v:info module-name "Stopping...")
        (loop until (with-simple-restart (retry "Retry stopping the module.")
                      (stop module)))
        module))))

(defun auth-p (nick)
{'fraction_non_alphanumeric': 0.15890213073311665, 'fraction_numerical': 0.00288912964969303, 'mean_word_length': 3.2419601837672283, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '5058515', 'n_tokens_mistral': 890, 'n_tokens_neox': 872, 'n_words': 265}