code: def renew_resnet_paths(old_list, n_shave_prefix_segments=0):
      mapping = []
      for old_item in old_list:
          new_item = old_item
          new_item = new_item.replace("block.", "resnets.")
          new_item = new_item.replace("conv_shorcut", "conv1")
          new_item = new_item.replace("in_shortcut", "conv_shortcut")
          new_item = new_item.replace("temb_proj", "time_emb_proj")
  
          new_item = shave_segments(
              new_item, n_shave_prefix_segments=n_shave_prefix_segments
          )
  
          mapping.append({"old": old_item, "new": new_item})
  
      return mapping
  
file_path: llmga/llmga/diffusers/scripts/convert_ddpm_original_checkpoint_to_diffusers.py
imports: import argparse
  import json
  import torch
  from diffusers import AutoencoderKL, DDPMPipeline, DDPMScheduler, UNet2DModel, VQModel
label_desc: Use image node_id 2 for calling a global function with example usage: renew_resnet_paths(old_list, n_shave_prefix_segments) and returns: mapping