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: environment_utils.rb
    path of file: ./repos/puppet/acceptance/lib/puppet/acceptance
    
    the code of the file until where you have to start completion: require 'puppet/acceptance/module_utils'

module Puppet
  module Acceptance
    module Envir
    
      def safely_shadow_directory_contents_and_yield(host, original_path, new_path, &block)
        original_files = get_directory_hash_from(host, original_path)
        new_files = get_directory_hash_from(host, new_path)
        conflicts = original_files.keys & new_files.keys

        step "backup original files" do
          conflicts.each do |c|
            on(host, "mv #{original_files[c]} #{original_files[c]}.bak")
          end
        end

        step "shadow original files with temporary files" do
          new_files.each do |name,full_path_name|
            on(host, "cp -R #{full_path_name} #{original_path}/#{name}")
          end
        end

        new_file_list = new_files.keys.map { |name| "#{original_path}/#{name}" }.join(' ')
        step "open permissions to 755 on all temporary files copied into working dir and set ownership" do
          on(host, "chown -R #{host.puppet['user']}:#{host.puppet['group']} #{new_file_list}")
          on(host, "chmod -R 755 #{new_file_list}")
        end

        if host.check_for_command("selinuxenabled")
          result = on(host, "selinuxenabled", :acceptable_exit_codes => [0,1])

          if result.exit_code == 0
            step "mirror selinux contexts" do
              context = on(host, "matchpathcon #{original_path}").stdout.chomp.split(' ')[1]
              on(host, "chcon -R #{context} #{new_file_list}")
            end
          end