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

require "concurrent/map"

require "dry/initializer"
require "dry/validation/constants"
require "dry/validation/schema_ext"

module Dry
  module Validation
    # Contract objects apply rules to input
    #
    # A contract consists of a schema and rules. The schema is applied to the
    # input before rules are applied, this way you can be sure that your rules
    # won't be applied to values that didn't pass schema checks.
    #
    # It's up to you how exactly you're going to separate sch
    
      def call(input, context = EMPTY_HASH)
        validate_input_type(input)

        context_map = Concurrent::Map.new.tap do |map|
          default_context.each { |key, value| map[key] = value }
          context.each { |key, value| map[key] = value }
        end

        Result.new(schema.(input), context_map) do |result|
          rules.each do |rule|
            next if rule.keys.any? { |key| error?(result, key) }

            rule_result = rule.(self, result)

            rule_result.failures.each do |failure|
              result.add_error(message_resolver.(**failure))
            end
          end
        end
      end