@to_tuple<EOL>def get_depths_and_dimensions(data, depth):
if not isinstance(data, (list, tuple)):<EOL><INDENT>return ()<EOL><DEDENT>yield depth, len(data)<EOL>for item in data:<EOL><INDENT>yield from get_depths_and_dimensions(item, depth + <NUM_LIT:1>)<EOL><DEDENT>
Yields 2-length tuples of depth and dimension of each element at that depth