code: def delete_ext_safe(dir_path, extensions=[], logging=False):
      """
      ## delete_ext_safe
  
      Safely deletes files with given extensions at given path.
  
      Parameters:
          dir_path (string): path to the directory
          extensions (list): list of extensions to be deleted
          logging (bool): enables logging for its operations
  
      """
      if not extensions or not os.path.exists(dir_path):
          logger.warning("Invalid input provided for deleting!")
          return
  
      logger.critical("Clearing Assets at `{}`!".format(dir_path))
  
      for ext in extensions:
          if len(ext) == 2:
              files_ext = [
                  os.path.join(dir_path, f)
                  for f in os.listdir(dir_path)
                  if f.startswith(ext[0]) and f.endswith(ext[1])
              ]
          else:
              files_ext = [
                  os.path.join(dir_path, f)
                  for f in os.listdir(dir_path)
                  if f.endswith(ext)
              ]
          for file in files_ext:
              delete_file_safe(file)
              logging and logger.debug(
                  "Deleted file: `{}`".format(file)
              )
  
imports: import os
  import re
  import sys
  import cv2
  import types
  import errno
  import stat
  import shutil
  import importlib
  import requests
  import numpy
  import logging
  import platform
  import socket
  from tqdm import tqdm
  from contextlib import closing
  from pathlib import Path
  from colorlog import ColoredFormatter
  from pkg_resources import parse_version
  from requests.adapters import HTTPAdapter, Retry
  from ..version import __version__
label_desc: Use image node_id 23 for calling a global function with example usage: delete_ext_safe(dir_path, extensions, logging) without return types