def manhattan_distance(a, b):
if ( ((type(a) == float) and (type(b) == float)) or ((type(a) == int) and (type(b) == int)) ):<EOL><INDENT>return abs(a - b);<EOL><DEDENT>distance = <NUM_LIT:0.0>;<EOL>dimension = len(a);<EOL>for i in range(<NUM_LIT:0>, dimension):<EOL><INDENT>distance += abs(a[i] - b[i]);<EOL><DEDENT>return distance<EOL>
!
    @brief Calculate Manhattan distance between vector a and b.

    @param[in] a (list): The first cluster.
    @param[in] b (list): The second cluster.

    @return (double) Manhattan distance between two vectors.