code: def attribute_difference(att_diff):
      ''' The attribute distance.
      '''
  
      ret = 0
      for a_value, b_value in att_diff:
          if max(a_value, b_value) == 0:
              ret += 0
          else:
              ret += abs(a_value - b_value) * 1.0 / max(a_value, b_value)
      return ret * 1.0 / len(att_difff attribute_difference(att_diff):
      ''' The attribute distance.
      '''
  
      ret = 0
      for a_value, b_value in att_diff:
          if max(a_value, b_value) == 0:
              ret += 0
          else:
              ret += abs(a_value - b_value) * 1.0 / max(a_value, b_value)
      return ret * 1.0 / len(att_diff)
docs: The attribute distance.