code: def clear_filename(filename: str) -> str:
      """
      Removes path symbols from filename which could be used for path injection
      :param filename: input filename
      :return: output filename
      """
  
      if not filename:
          return filename
      badchars = '\\/:*?"<>|'
      for c in badchars:
          filename = filename.replace(c, "")
      return filename
  
imports: from urllib.parse import urlparse
  import socket
  import ipaddress
label_desc: Use image node_id 2 for calling a global function with example usage: clear_filename(filename) and returns: filename, filename