<commit_before># frozen_string_literal: true

class Baseballbot
  module Template
    class Shared
      class MarkdownCalendar
        class << self
          def generate(cells, dates)
            <<~TABLE
              S|M|T|W|T|F|S
              :-:|:-:|:-:|:-:|:-:|:-:|:-:
              #{calendar_rows(cells, dates).join("\n")}
            TABLE
          end

          protected

          def calendar_rows(cells, dates)
            [
              *blank_start(dates.values.first[:date]),
              cells,
              *blank_end(dates.values.last[:date])
            ].each_slice(7).map { |row| row.join('|') }
          end

          def blank_start(date)
            [' '] * ((7 - date.wday) % 7)
          end

          def blank_end(date)
            [' '] * (6 - date.wday)
          end
        end
      end
    end
  end
end<commit_msg>fix<commit_after># frozen_string_literal: true

class Baseballbot
  module Template
    class Shared
      class MarkdownCalendar
        class << self
          def generate(cells, dates)
            <<~TABLE
              S|M|T|W|T|F|S
              :-:|:-:|:-:|:-:|:-:|:-:|:-:
              #{calendar_rows(cells, dates).join("\n")}
            TABLE
          end

          protected

          def calendar_rows(cells, dates)
            [
              *blank_start(dates.values.first[:date]),
              *cells,
              *blank_end(dates.values.last[:date])
            ].each_slice(7).map { |row| row.join('|') }
          end

          def blank_start(date)
            [' '] * ((7 - date.wday) % 7)
          end

          def blank_end(date)
            [' '] * (6 - date.wday)
          end
        end
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.14052478134110788, 'fraction_numerical': 0.004664723032069971, 'mean_word_length': 1.2971887550200802, 'pattern_counts': {'":': 0, '<': 11, '<?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': '3102920', 'n_tokens_mistral': 539, 'n_tokens_neox': 517, 'n_words': 97}