<commit_before>module Gitlab
  class Util
    class << self
      def get_env(key)
        ENV[key]&.strip
      end

      def set_env(key, value)
        ENV[key] = value&.strip
      end

      def set_env_if_missing(key, value)
        ENV[key] ||= value&.strip
      end
    end
  end
end<commit_msg>Add section, section_start and section_end helpers<commit_after>module Gitlab
  class Util
    class << self
      def get_env(key)
        ENV[key]&.strip
      end

      def set_env(key, value)
        ENV[key] = value&.strip
      end

      def set_env_if_missing(key, value)
        ENV[key] ||= value&.strip
      end

      def section(name, description = name, &block)
        section_start(name, description)

        yield

        section_end(name)
      end

      def section_start(name, description = name)
        return unless ENV['CI']

        @section_name = name
        $stdout.puts "section_start:#{Time.now.to_i}:#{name}\r\e[0K#{description}"
      end

      def section_end(name = @section_name)
        return unless ENV['CI']

        $stdout.puts "section_end:#{Time.now.to_i}:#{name}\r\e[0K"
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.10831889081455806, 'fraction_numerical': 0.0017331022530329288, 'mean_word_length': 2.1557377049180326, 'pattern_counts': {'":': 0, '<': 7, '<?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': '4467867', 'n_tokens_mistral': 398, 'n_tokens_neox': 383, 'n_words': 85}