<commit_before>module Seed
  class Snapshot
    def initialize(configuration)
      @configuration = configuration
    end

    def dump(classes = [], ignore_classes = [], force_dump = false)
      @configuration.make_tmp_dir

      if exist_path? && !force_dump
        puts 'Dump file already exists for current schema.'
        return
      end

      Mysql.dump(
        @configuration.current_version_path,
        options.merge({
          tables: tables(classes),
          ignore_tables: ignore_tables(ignore_classes),
          client_version: @configuration.client_version
        })
      )
    end

    def restore
      @configuration.make_tmp_dir

      unless exist_path?
        puts "Dump file does not exist for current schema."
        return
      end

      Mysql.restore(
        @configuration.current_version_path,
        options
      )
    end

    def clean
      unless exist_path?
        puts "Dump file does not exist for current schema."
        return
      end

      version_path = @configuration.current_version_path
      File.delete(version_path)
    end
<commit_msg>fix Ruby 2.7 kwargs warning.<commit_after>module Seed
  class Snapshot
    def initialize(configuration)
      @configuration = configuration
    end

    def dump(classes = [], ignore_classes = [], force_dump = false)
      @configuration.make_tmp_dir

      if exist_path? && !force_dump
        puts 'Dump file already exists for current schema.'
        return
      end

      Mysql.dump(
        @configuration.current_version_path,
        **options.merge({
          tables: tables(classes),
          ignore_tables: ignore_tables(ignore_classes),
          client_version: @configuration.client_version
        })
      )
    end

    def restore
      @configuration.make_tmp_dir

      unless exist_path?
        puts "Dump file does not exist for current schema."
        return
      end

      Mysql.restore(
        @configuration.current_version_path,
        **options
      )
    end

    def clean
      unless exist_path?
        puts "Dump file does not exist for current schema."
        return
      end

      version_path = @configuration.current_version_path
      File.delete(version_path)
    end

{'fraction_non_alphanumeric': 0.06633796503809951, 'fraction_numerical': 0.0008964589870013447, 'mean_word_length': 2.148095909732017, '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': '1029869', 'n_tokens_mistral': 602, 'n_tokens_neox': 589, 'n_words': 158}