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: package_medium_container.rb
    path of file: ./repos/open-build-service/src/api/app/models/concerns
    
    the code of the file until where you have to start completion: module PackageMediumContainer
  extend ActiveSupport::Concern

  # local mode (default): last package in link chain in my project
  # no local mode:        first package in link chain outside of my project
  def origin_container(options = { local: true })
    # link target package name is more important, since local name could be
    # extended. For example in m
    
  def add_containers(opts = {})
    container_list = {}

    # ensure to start with update project
    update_pkg = origin_container(local: false).update_instance
    # we need to take update project and all projects linking to into account
    update_pkg.project.expand_all_projects.each do |prj|
      origin_package = prj.packages.find_by_name(update_pkg.name)
      next unless origin_package

      origin_package.binary_releases.where(obsolete_time: nil).find_each do |binary_release|
        mc = binary_release.medium_container
        if mc
          mc_update_project = mc.project.update_instance_or_self
          # pick only one and the highest container.
          identifier = "#{mc_update_project.name}/#{mc.name}"
          # esp. in maintenance update projects where the name suffix is the counter
          identifier.gsub!(/\.[^.]*$/, '') if mc_update_project.is_maintenance_release?
          next if container_list[identifier] && container_list[identifier].name > mc.name

          container_list[identifier] = mc
        end
      end
    end