code: def rreplace(s: str, old: str, new: str) -> str:
      """
      Replace end of string.
  
      Args:
          s (str): string to operate on
          old (str): ending of string to replace
          new (str): replacement for ending of string
      Returns:
          new.join(li) (string): new string with end replaced
      """
      li = s.rsplit(old, 1)
      return new.join(li)
  
imports: import json
  import os
  from collections import Counter
  from collections import OrderedDict
  from pathlib import Path
  from typing import Dict, List, Union
  import librosa
  import numpy
  from nemo.collections.asr.parts.utils.speaker_utils import audio_rttm_map, get_subsegments, get_uniqname_from_filepath, rttm_to_labels, segments_manifest_to_subsegments_manifest, write_rttm2manifest
  from nemo.utils.data_utils import DataStoreObject
label_desc: Use image node_id 3 for calling a global function with example usage: rreplace(s, old, new) and returns: new