def chop_list(lst, chop_length, filler=None):
    """Chops a list into a list of lists. Used to generate a plate map
    corresponding to microplate layouts.

    Parameters
    ----------
    lst: list
        The original list that needs to be chopped up
    chop_length: Int
        The length of the pieces to chop the big list into
    filler: Int, optional
        The stuff to fill up the leftover pieces

    Returns
    -------
    List
        Returns the correct well indices of all the quad-specific wells in
        quadwells

    """
    assert chop_length > 0
    ret = []
    row_idx = 0
    while True:
        row = lst[row_idx * chop_length:(row_idx + 1) * chop_length]
        row_idx += 1
        row_len = len(row)
        if row_len == 0:
            return ret
        elif row_len == chop_length:
            ret.append(row)
        else:
            ret.append(row + [filler] * (chop_length - row_len))
            return ret
    return ret
