code: def hamming_distance(first_hash, other_hash, hashbits=32):
      x = (first_hash ^ other_hash) & ((1 << hashbits) - 1)
      tot = 0
      while x:
          tot += 1
          x &= x - 1
      return tot
  
imports: from __future__ import division
  import random
  from collections import defaultdict
  from math import log
  from whoosh.compat import xrange, iteritems
label_desc: Use image node_id 4 for calling a global function with example usage: hamming_distance(first_hash, other_hash, hashbits) and returns: tot