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: chewy.rb
    path of file: ./repos/chewy/lib
    
    the code of the file until where you have to start completion: require 'active_support'
require 'active_support/version'
require 'active_support/concern'
require 'active_suppor
    
    def derive_name(index_name)
      return index_name if index_name.is_a?(Class) && index_name < Chewy::Index

      class_name = "#{index_name.camelize.gsub(/Index\z/, '')}Index"
      index = class_name.safe_constantize

      return index if index && index < Chewy::Index

      raise Chewy::UndefinedIndex, "Can not find index named `#{class_name}`"
    end