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: inferred_spec_type.rb
    path of file: ./repos/rubocop-rspec/lib/rubocop/cop/rspec/rails
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

module RuboCop
  module Cop
    module RSpec
      module Rails
        # Identifies redundant spec type.
        #
        # After setting up rspec-rails, you will have enabled
        # `config.infer_spec_type_from_file_location!` by default in
    
          def on_block(node)
            return unless example_group?(node)

            pair_node = describe_with_type(node)
            return unless pair_node
            return unless inferred_type?(pair_node)

            removable_node = detect_removable_node(pair_node)
            add_offense(removable_node) do |corrector|
              autocorrect(corrector, removable_node)
            end
          end