def tupilate(source, val):
    """Broadcasts val to be a tuple of same size as source"""
    if isinstance(val, tuple):
        assert(len(val) == len(source))
        return val
    else:
        return (val,)*len(source)