def exact_comp(val1, val2):
  """Compare the two given attribute values exactly, return 1 if they are the
     same (but not both empty!) and 0 otherwise.
  """

  # If at least one of the values is empty return 0
  #
  if (len(val1) == 0) or (len(val2) == 0):
    return 0.0

  elif (val1 != val2):
    return 0.0
  else:  # The values are the same
    return 1.0