def integer_bit_count(number):
  """
  Returns the number of set (1) bits in an unsigned integer.

  :param number:
      An integer. If this is a negative integer, its absolute
      value will be considered.
  :returns:
      The number of set bits in an unsigned integer.
  """
  # Licensed under the PSF License.
  # Taken from http://wiki.python.org/moin/BitManipulation
  number = abs(number)
  count = 0
  while number:
    number &= number - 1
    count += 1
  return count