def expand_shape(seq, l, fill_value=None):
    """Expand a sequence with a fill value """
    seq = tuple(seq)
    if len(seq) > l:
       return seq
    seq = ((l - len(seq)) * (fill_value,)) + seq
    return seq