def shape(seq, strict=False, types=(list, tuple)):
    """
    Return the shape of a list of lists.

    Examples:
        >>> L = [[0, 1, 2],
        ...      [3, 4, 5]]
        >>> shape(L,)
        (2, 3)
    """
    shape = []
    curr = seq
    if not strict:
        while isinstance(curr, types):
            shape.append(len(curr))
            try:
                curr = curr[0]
            except IndexError:
                break
    else:
        return NotImplemented
    return tuple(shape)
