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: inspection.rb
    path of file: ./repos/ekylibre/app/models
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

# = Informations
#
# == License
#
# Ekylibre - Simple agricultural ERP
# Copyright (C) 2008-2009 Brice Texier, Thibaud Merigon
# Copyright (C) 2010-2012 Brice Texier
# Copyright (C) 2012-2014 Brice Texier, David Joulin
# Copyright (C) 201
    
    def calibration_values(dimension, method_name, scale = nil, marketable = false)
      on_scales = [scale]
      on_scales = scales if scale.nil?
      return 0 if on_scales.empty?

      sum_per_calib = on_scales.map do |s|
        calib = calibrations.of_scale(s)
        calib = calib.marketable if marketable
        calib.map(&mappable(method_name, dimension)).compact.sum
      end
      sum_per_calib.compact.reject(&:zero?).sum / sum_per_calib.size
    end