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

require_relative 'services/logger/null'

module Services
  include GemConfig::Base

  NoBackgroundProcessorFound = Class.new(StandardError)
  RedisNotFound         
    
    def replace_global_ids_with_records(arg)
      method = method(__method__)

      case arg
      when Array  then arg.map(&method)
      when Hash   then arg.transform_keys(&method)
                          .transform_values(&method)
      when String then (arg.starts_with?("_") && GlobalID::Locator.locate(arg[1..-1])) || arg
      else arg
      end