code: def generate_hashes(
      peaks: List[Tuple[int, int]], fan_value: int = DEFAULT_FAN_VALUE
  ) -> List[Tuple[str, int]]:
      """
      Hash list structure:
         sha1_hash[0:FINGERPRINT_REDUCTION]    time_offset
          [(e05b341a9b77a51fd26, 32), ... ]
  
      :param peaks: list of peak frequencies and times.
      :param fan_value: degree to which a fingerprint can be paired with its neighbors.
      :return: a list of hashes with their corresponding offsets.
      """
      # frequencies are in the first position of the tuples
      idx_freq = 0
      # times are in the second position of the tuples
      idx_time = 1
  
      if PEAK_SORT:
          peaks.sort(key=itemgetter(1))
  
      hashes = []
      for i in range(len(peaks)):
          for j in range(1, fan_value):
              if (i + j) < len(peaks):
                  freq1 = peaks[i][idx_freq]
                  freq2 = peaks[i + j][idx_freq]
                  t1 = peaks[i][idx_time]
                  t2 = peaks[i + j][idx_time]
                  t_delta = t2 - t1
  
                  if (
                      MIN_HASH_TIME_DELTA
                      <= t_delta
                      <= MAX_HASH_TIME_DELTA
                  ):
                      h = hashlib.sha1(
                          f"{str(freq1)}|{str(freq2)}|{str(t_delta)}".encode(
                              "utf-8"
                          )
                      )
  
                      hashes.append(
                          (h.hexdigest()[0:FINGERPRINT_REDUCTION], t1)
                      )
  
      return hashes
  
file_path: dejavu/dejavu/logic/fingerprint.py
imports: import hashlib
  from operator import itemgetter
  from typing import List, Tuple
  import matplotlib.mlab
  import matplotlib.pyplot
  import numpy
  from scipy.ndimage.filters import maximum_filter
  from scipy.ndimage.morphology import binary_erosion, generate_binary_structure, iterate_structure
  from dejavu.config.settings import CONNECTIVITY_MASK, DEFAULT_AMP_MIN, DEFAULT_FAN_VALUE, DEFAULT_FS, DEFAULT_OVERLAP_RATIO, DEFAULT_WINDOW_SIZE, FINGERPRINT_REDUCTION, MAX_HASH_TIME_DELTA, MIN_HASH_TIME_DELTA, PEAK_NEIGHBORHOOD_SIZE, PEAK_SORT
label_desc: Use image node_id 3 for calling a global function with example usage: generate_hashes(peaks, fan_value) and returns: hashes