code: def undo(key, obj, field):
      """Undoes the peplacement by the patch().
  
      If the function is not replaced, raises an exception.
  
      Arguments:
          key: identifying information for who is doing the replacement. You can use __name__.
          obj: the module or the class
          field: name of the function as a string
  
      Returns:
          Always None
      """
  
      patch_key = (obj, field)
  
      if patch_key not in originals[key]:
          raise RuntimeError(f"there is no patch for {field} to undo")
  
      original_func = originals[key].pop(patch_key)
      setattr(obj, field, original_func)
  
      return None
  
imports: from collections import defaultdict
label_desc: Use image node_id 2 for calling a global function with example usage: undo(key, obj, field) and returns: None