def split_value(v, n=2):
    """
    If ``v`` is a list of ``n`` elements, return it; if it is
    'undefined', return a list of ``n`` 'undefined' values; else
    generate an error
    """
    if v == 'undefined':
        return ['undefined'] * n
    else:
        assert len(v) == n, 'Value wrong length'
        return v
