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: helpers.rb
    path of file: ./repos/devise_masquerade/lib/devise_masquerade/controllers
    
    the code of the file until where you have to start completion: module DeviseMasquerade
  module Controllers
    module Helpers
      def self.define_helpers(mapping
    
          def masquerade_#{name}!
            return if params["#{Devise.masquerade_param}"].blank?

            resource = GlobalID::Locator.locate_signed params[Devise.masquerade_param], for: 'masquerade'

            if resource
              masquerade_sign_in(resource)
            end