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: cascade.rb
    path of file: ./repos/i18n/lib/i18n/backend
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

# The Cascade module adds the ability to do cascading lookups to backends that
# are compatible to the Simple backend.
#
# By cascading lookups we mean that for any key that can not be found the
# Cascade module strips one segment off the scope part of the key and then
# tries to look up the key in that scope.
#
# E.g. when a lookup for the key :"foo.bar.baz" does not yield a result then
# the segment :bar will be stripped off the scope part :"foo.bar" and the new
# scope :foo will be used to look up the key :
    
      def lookup(locale, key, scope = [], options = EMPTY_HASH)
        return super unless cascade = options[:cascade]

        cascade   = { :step => 1 } unless cascade.is_a?(Hash)
        step      = cascade[:step]   || 1
        offset    = cascade[:offset] || 1
        separator = options[:separator] || I18n.default_separator
        skip_root = cascade.has_key?(:skip_root) ? cascade[:skip_root] : true

        scope = I18n.normalize_keys(nil, key, scope, separator)
        key   = (scope.slice!(-offset, offset) || []).join(separator)

        begin
          result = super
          return result unless result.nil?
          scope = scope.dup
        end while (!scope.empty? || !skip_root) && scope.slice!(-step, step)
      end