def get(row, delimiter, indices):
    """Extract key and value from row.

    >>> get('a,b,c', ',', (0, 1))
    (('a', 'b'), ('c',))
    >>> get('a,b,c', ',', (0, 2))
    (('a', 'c'), ('b',))
    """
    row = row.rstrip().split(delimiter)

    key = tuple(row[k] for k in indices)
    val = tuple(v for i, v in enumerate(row) if i not in indices)

    return key, val