code: def find_similar_images(userpaths, hashfunc=imagehash.average_hash):
      def is_image(filename):
          f = filename.lower()
          return (
              f.endswith(".png")
              or f.endswith(".jpg")
              or f.endswith(".jpeg")
              or f.endswith(".bmp")
              or f.endswith(".gif")
              or ".jpg" in f
              or f.endswith(".svg")
          )
  
      image_filenames = []
      for userpath in userpaths:
          image_filenames += [
              os.path.join(userpath, path)
              for path in os.listdir(userpath)
              if is_image(path)
          ]
      images = {}
      for img in sorted(image_filenames):
          try:
              hash = hashfunc(Image.open(img))
          except Exception as e:
              print("Problem:", e, "with", img)
              continue
          if hash in images:
              print(img, "  already exists as", " ".join(images[hash]))
              if "dupPictures" in img:
                  print("rm -v", img)
          images[hash] = images.get(hash, []) + [img]
  
label_desc: Use image node_id 1 for calling a global function with example usage: find_similar_images(userpaths, hashfunc) and returns: unknown