original_docstring: 
              Finds hash matches that align in time with other matches and finds
              consensus about which hashes are "true" signal from the audio.
  
              Returns a dictionary with match information.
          
docstring: Finds hash matches that align in time with other matches and finds
  consensus about which hashes are "true" signal from the audio.
  
  Returns a dictionary with match information.
docstring_tokens: Finds hash matches that align in time with other matches and finds consensus about which hashes are " true " signal from the audio . Returns a dictionary with match information .
code: def align_matches(self, matches):
          """
              Finds hash matches that align in time with other matches and finds
              consensus about which hashes are "true" signal from the audio.
  
              Returns a dictionary with match information.
          """
          # align by diffs
          diff_counter = {}
          largest = 0
          largest_count = 0
          song_id = -1
          for tup in matches:
              sid, diff = tup
              if diff not in diff_counter:
                  diff_counter[diff] = {}
              if sid not in diff_counter[diff]:
                  diff_counter[diff][sid] = 0
              diff_counter[diff][sid] += 1
  
              if diff_counter[diff][sid] > largest_count:
                  largest = diff
                  largest_count = diff_counter[diff][sid]
                  song_id = sid
  
          # extract idenfication
          song = self.db.get_song_by_id(song_id)
          if song:
              # TODO: Clarify what `get_song_by_id` should return.
              songname = song.get(Dejavu.SONG_NAME, None)
          else:
              return None
  
          # return match info
          nseconds = round(float(largest) / fingerprint.DEFAULT_FS *
                           fingerprint.DEFAULT_WINDOW_SIZE *
                           fingerprint.DEFAULT_OVERLAP_RATIO, 5)
          song = {
              Dejavu.SONG_ID : song_id,
              Dejavu.SONG_NAME : songname.encode("utf8"),
              Dejavu.CONFIDENCE : largest_count,
              Dejavu.OFFSET : int(largest),
              Dejavu.OFFSET_SECS : nseconds,
              Database.FIELD_FILE_SHA1 : song.get(Database.FIELD_FILE_SHA1, None).encode("utf8"),}
          return song
code_tokens: def align_matches ( self , matches ) : diff_counter = { } largest = 0 largest_count = 0 song_id = - 1 for tup in matches : sid , diff = tup if diff not in diff_counter : diff_counter [ diff ] = { } if sid not in diff_counter [ diff ] : diff_counter [ diff ] [ sid ] = 0 diff_counter [ diff ] [ sid ] += 1 if diff_counter [ diff ] [ sid ] > largest_count : largest = diff largest_count = diff_counter [ diff ] [ sid ] song_id = sid song = self . db . get_song_by_id ( song_id ) if song : songname = song . get ( Dejavu . SONG_NAME , None ) else : return None nseconds = round ( float ( largest ) / fingerprint . DEFAULT_FS * fingerprint . DEFAULT_WINDOW_SIZE * fingerprint . DEFAULT_OVERLAP_RATIO , 5 ) song = { Dejavu . SONG_ID : song_id , Dejavu . SONG_NAME : songname . encode ( "utf8" ) , Dejavu . CONFIDENCE : largest_count , Dejavu . OFFSET : int ( largest ) , Dejavu . OFFSET_SECS : nseconds , Database . FIELD_FILE_SHA1 : song . get ( Database . FIELD_FILE_SHA1 , None ) . encode ( "utf8" ) , } return song
short_docstring: Finds hash matches that align in time with other matches and finds
  consensus about which hashes are "true" signal from the audio.
short_docstring_tokens: Finds hash matches that align in time with other matches and finds consensus about which hashes are " true " signal from the audio .
comment: """
              Finds hash matches that align in time with other matches and finds
              consensus about which hashes are "true" signal from the audio.
  
              Returns a dictionary with match information.
          """$SEP$# align by diffs$SEP$# extract idenfication$SEP$# TODO: Clarify what `get_song_by_id` should return.$SEP$# return match info