defalg_wtahash(vec:Sequence[float],bits)->bytes:"""Calculate WTA Hash for vector with 380 values (MP7 frame signature)."""h=[]forperminWTA_VIDEO_ID_PERMUTATIONS:v=vec[perm[0]],vec[perm[1]]h.append(v.index(max(v)))iflen(h)==bits:breakh=bitarray(h).tobytes()returnh