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: registry.rb
    path of file: ./repos/chef/lib/chef/win32
    
    the code of the file until where you have to start completion: #
# Author:: Prajakta Purohit (<prajakta@chef.io>)
# Author:: Lamont Granquist (<lamont@chef.io>)
#
# Copyright:: Copyright (c) Chef Softwar
    
      def delete_key(key_path, recursive)
        Chef::Log.trace("Deleting registry key #{key_path}")
        unless key_exists?(key_path)
          Chef::Log.trace("Registry key #{key_path}, does not exist, not deleting")
          return true
        end
        if has_subkeys?(key_path) && !recursive
          raise Chef::Exceptions::Win32RegNoRecursive, "Registry key #{key_path} has subkeys, and recursive not specified"
        end