docstr: Given a directory and a set of extensions it fingerprints all files that match each extension specified.
  
  :param path: path to the directory.
  :param extensions: list of file extensions to consider.
  :param nprocesses: amount of processes to fingerprint the files within the directory.
docstr_tok: ["Given","a","directory","and","a","set","of","extensions","it","fingerprints","all","files","that","match","each","extension","specified",".",":","param","path",":","path","to","the","directory",".",":","param","extensions",":","list","of","file","extensions","to","consider",".",":","param","nprocesses",":","amount","of","processes","to","fingerprint","the","files","within","the","directory","."]
code: def fingerprint_directory(
      self, path: str, extensions: str, nprocesses: int = None
  ) -> None:
      """
      Given a directory and a set of extensions it fingerprints all files that match each extension specified.
  
      :param path: path to the directory.
      :param extensions: list of file extensions to consider.
      :param nprocesses: amount of processes to fingerprint the files within the directory.
      """
      # Try to use the maximum amount of processes if not given.
      try:
          nprocesses = nprocesses or multiprocessing.cpu_count()
      except NotImplementedError:
          nprocesses = 1
      else:
          nprocesses = 1 if nprocesses <= 0 else nprocesses
  
      pool = multiprocessing.Pool(nprocesses)
  
      filenames_to_fingerprint = []
      for filename, _ in decoder.find_files(path, extensions):
          # don't refingerprint already fingerprinted files
          if decoder.unique_hash(filename) in self.songhashes_set:
              print(f"{filename} already fingerprinted, continuing...")
              continue
  
          filenames_to_fingerprint.append(filename)
  
      # Prepare _fingerprint_worker input
      worker_input = list(
          zip(
              filenames_to_fingerprint,
              [self.limit] * len(filenames_to_fingerprint),
          )
      )
  
      # Send off our tasks
      iterator = pool.imap_unordered(
          Dejavu._fingerprint_worker, worker_input
      )
  
      # Loop till we have all of them
      while True:
          try:
              song_name, hashes, file_hash = next(iterator)
          except multiprocessing.TimeoutError:
              continue
          except StopIteration:
              break
          except Exception:
              print("Failed fingerprinting")
              # Print traceback because we can't reraise it here
              traceback.print_exc(file=sys.stdout)
          else:
              sid = self.db.insert_song(
                  song_name, file_hash, len(hashes)
              )
  
              self.db.insert_hashes(sid, hashes)
              self.db.set_song_fingerprinted(sid)
              self.__load_fingerprinted_audio_hashes()
  
      pool.close()
      pool.join()
  
imports: import multiprocessing
  import os
  import sys
  import traceback
  from itertools import groupby
  from time import time
  from typing import Dict, List, Tuple
  import dejavu.logic.decoder
  from dejavu.base_classes.base_database import get_database
  from dejavu.config.settings import DEFAULT_FS, DEFAULT_OVERLAP_RATIO, DEFAULT_WINDOW_SIZE, FIELD_FILE_SHA1, FIELD_TOTAL_HASHES, FINGERPRINTED_CONFIDENCE, FINGERPRINTED_HASHES, HASHES_MATCHED, INPUT_CONFIDENCE, INPUT_HASHES, OFFSET, OFFSET_SECS, SONG_ID, SONG_NAME, TOPN
  from dejavu.logic.fingerprint import fingerprint
label_desc: Use image node_id 5 for calling the Dejavu obj's underlying member method code with example usage: obj.fingerprint_directory(path, extensions, nprocesses) without return types