<commit_before>require "cangrejo/restclient/request_extensions"
require "cangrejo/restclient/json_resource"
require "cangrejo/support/launcher"

module Cangrejo
  module Modes
    class Local

      def initialize(_path)
        @path = _path
      end

      def setup
        init_launcher
        init_rest_client
      end

      def release
        @launcher.kill
      end

    private

      def init_launcher
        @launcher = Support::Launcher.new @path
        @launcher.launch
      end<commit_msg>fix(modes.local): adds launcher nil check on session release<commit_after>require "cangrejo/restclient/request_extensions"
require "cangrejo/restclient/json_resource"
require "cangrejo/support/launcher"

module Cangrejo
  module Modes
    class Local

      def initialize(_path)
        @path = _path
      end

      def setup
        init_launcher
        init_rest_client
      end

      def release
        @launcher.kill unless @launcher.nil?
      end

    private

      def init_launcher
        @launcher = Support::Launcher.new @path
        @launcher.launch
      end
{'fraction_non_alphanumeric': 0.05957836846929423, 'fraction_numerical': 0.0, 'mean_word_length': 2.3703703703703702, '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': '3487143', 'n_tokens_mistral': 349, 'n_tokens_neox': 322, 'n_words': 76}