def expand_to_list(item, n):
    """Expands item into list of n length, unless already a list."""
    if type(item) is list:
        assert len(item) == n
        return item
    else:
        return [item for _ in range(n)]