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: dpkg_package_spec.rb
    path of file: ./repos/chef/spec/functional/resource
    
    the code of the file until where you have to start completion: #
# Copyright:: Copyright (c) Chef Software Inc.
# Licens
    
  def should_be_purged_or_removed(package, action = nil)
    status = shell_out("dpkg -s #{package}")
    output = status.stdout + status.stderr
    if action.nil? || action == :purge
      expect(output).to match(/no info|not-installed|not installed/)
    elsif action == :remove
      expect(output).to match(/deinstall ok config-files/)
    else
      raise "Unknown action"
    end