You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: key_value.rb
    path of file: ./repos/mobility/lib/mobility/backends/sequel
    
    the code of the file until where you have to start completion: # frozen-string-literal: true
require "set"
require "mobility/util"
require "mobility/backends/sequel"
require "mobility/backends/key_value"

module Mobility
  module Backends
=begin

Implements the {Mobility::Backends::KeyValue} backend for Sequel models.

@note This backend requires the cache to be enabled in order to track
  and store changed translations, since Sequel does not support +build+-type
  methods on associations like ActiveRecord.

=end
    class Sequel::KeyValue
      include Sequel
      include KeyValue
      include Util

      class << self
        # @!group Backend Configuration
        # @option (see Mobility::Backends::KeyValue::ClassMethods#configure)
        # @raise (see Mobility::Backends::KeyValue::ClassMethods#configure)
        # @raise [CacheRequired] if cache is disabled
        def configure(options)
          raise CacheRequired, "Cache required for Sequel::KeyValue backend" if options[:cache] == false
          super
          if type = options[:type]
            options[:association_name] ||= :"#{options[:type]}_translations"
            options[:class_name]       ||= const_get("#{type.capitalize}Translation")
          end
        rescue NameError
          raise ArgumentError, "You must define a Mobility::Sequel::#{type.capitalize}Translation class."
        end
        # @!endgroup

        def build_op(attr, locale)
          QualifiedIdentifier.new(table_alias(attr, locale), value_column, locale, self, attr)
        end

        # @param [Sequel::Dataset] dataset Dataset to prepare
        # @param [Object] predicate Predicate
        # @param [Symbol] locale Locale
        # @return [Sequel::Dataset] Prepared dataset
        def prepare_dataset(dataset, predicate, locale)
          visit(predicate, locale).inject(dataset) do |ds, (attr, join_type)|
            join_translations(ds, att
    
        def included(base)
          @descendants ||= Set.new
          @descendants << base

          mod = self
          key_column = mod.key_column
          id_column = mod.id_column
          type_column = mod.type_column

          base.class_eval do
            plugin :validation_helpers

            # Paraphased from sequel_polymorphic gem
            #
            model = underscore(self.to_s)
            plural_model = pluralize(model)
            many_to_one mod.belongs_to,
              reciprocal: plural_model.to_sym,
              reciprocal_type: :many_to_one,
              setter: (proc do |able_instance|
                self[id_column]   = (able_instance.pk if able_instance)
                self[type_column] = (able_instance.class.name if able_instance)
              end),
              dataset: (proc do
                translatable_type = send type_column
                translatable_id   = send id_column
                return if translatable_type.nil? || translatable_id.nil?
                klass = self.class.send(:constantize, translatable_type)
                klass.where(klass.primary_key => translatable_id)
              end),
              eager_loader: (proc do |eo|
                id_map = {}
                eo[:rows].each do |model|
                  model_able_type = model.send type_column
                  model_able_id = model.send id_column
                  model.associations[belongs_to] = nil
                  ((id_map[model_able_type] ||= {})[model_able_id] ||= []) << model if !model_able_type.nil? && !model_able_id.nil?
                end
                id_map.each do |klass_name, id_map|
                  klass = constantize(camelize(klass_name))
                  klass.where(klass.primary_key=>id_map.keys).all do |related_obj|
                    id_map[related_obj.pk].each do |model|
                      model.associations[belongs_to] = related_obj
                    end
                  end
                end
              end)

            define_method :validate do
              super()
              validates_presence [:locale, key_column, id_column, type_column]
              validates_unique   [:locale, key_column, id_column, type_column]
            end
          end
        end
      end
      Translation = Translatable.new(:key, :value, :translatable)

      class TextTranslation < ::Sequel::Model(:mobility_text_translations)
        include Translation
      end

      class StringTranslation < ::Sequel::Model(:mobility_string_translations)
        include Translation
      end