code: def safecopy_modules(module_function_names, caller_modules):
      """
      Saves a reference to each module.function in list of strings module_function_names.
      References are made from dict caller_modules, from module name str to
      caller module obj.
      module.functions can be reassigned, replacing the current functions using
      restore_saved_modules(caller_modules)
  
      Example:
          from transformers.modeling_bert import BertSelfAttention
  
          caller_modules = {'BertSelfAttention': BertSelfAttention}
          original_forward = BertSelfAttention.forward
          safecopy_modules(['BertSelfAttention.forward'], caller_modules)
          BertSelfAttention.forward = None
          restore_saved_modules(caller_modules)
          assert( original_forward is BertSelfAttention.forward )
      """
      original_functions = registry.get(ORIGINAL_PATCH_FUNCTIONS_KEY)
      for module_function_name in module_function_names:
          module_name, function_name = module_function_name.split(".")
          module = caller_modules[module_name]
          function = getattr(module, function_name)
  
          # store function is nothing is stored,
          # prevents multiple calls from overwriting original function
          original_functions[
              module_function_name
          ] = original_functions.get(module_function_name, function)
  
imports: import importlib
  import logging
  import sys
  from mmf.common.registry import registry
  from packaging import version
label_desc: Use image node_id 2 for calling a global function with example usage: safecopy_modules(module_function_names, caller_modules) without return types