code: def patch_new_path(library_path, new_dir):
      library = osp.basename(library_path)
      name, *rest = library.split(".")
      rest = ".".join(rest)
      hash_id = hashlib.sha256(
          library_path.encode("utf-8")
      ).hexdigest()[:8]
      new_name = ".".join([name, hash_id, rest])
      return osp.join(new_dir, new_name)
  
imports: import glob
  import hashlib
  import os
  import os.path
  import platform
  import shutil
  import subprocess
  import sys
  import zipfile
  from base64 import urlsafe_b64encode
label_desc: Use image node_id 5 for calling a global function with example usage: patch_new_path(library_path, new_dir) and returns: osp