def pad(coll, size, padding, left=True):
    """
    Pad the collection `coll` with `padding` items
    until it reaches the length of `size`.
    By default do padding in the beginning (on the left side).
    """
    padding_size = size - len(coll)
    if padding_size <= 0:
        return coll
    padding = [padding] * padding_size
    new_list = list(coll)
    return padding + new_list if left else new_list + padding
