def pairs2map( pairs, key_col=0, value_col=1):
    """Converts a list of key value pairs to a dictionary.

    @type pairs:  array
    @param pairs: an array of key value paris,
                  representing a map as a list of tuples.
    @type key_col:  mixed
    @param key_col: the column that contains the key (default: 0)
    @type value_col:  mixed
    @param value_col: the column that contains the value (default: 1)

    @rtype:  dictionary
    @return: the key value pairs in pairs.

    """
    
    m = {}
    for p in pairs:
        k = p[key_col]
        m[ k ] = p[value_col]
        
    return m