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: portage.rb
    path of file: ./repos/chef/lib/chef/provider/package
    
    the code of the file until where you have to start completion: #
# Author:: Ezra Zygmuntowicz (<ezra@engineyard.com>)
# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License
    
        def candidate_version
          return @candidate_version if @candidate_version

          pkginfo = shell_out("portageq", "best_visible", "/", new_resource.package_name)

          if pkginfo.exitstatus != 0
            pkginfo.stderr.each_line do |line|
              # cspell:disable-next-line
              if /[Uu]nqualified atom .*match.* multiple/.match?(line)
                raise_error_for_query("matched multiple packages (please specify a category):\n#{pkginfo.inspect}")
              end
            end