def get_array_dimensions(data):
depths_and_dimensions = get_depths_and_dimensions(data, <NUM_LIT:0>)<EOL>grouped_by_depth = {<EOL>depth: tuple(dimension for depth, dimension in group)<EOL>for depth, group in groupby(depths_and_dimensions, itemgetter(<NUM_LIT:0>))<EOL>}<EOL>invalid_depths_dimensions = tuple(<EOL>(depth, dimensions)<EOL>for depth, dimensions in grouped_by_depth.items()<EOL>if len(set(dimensions)) != <NUM_LIT:1><EOL>)<EOL>if invalid_depths_dimensions:<EOL><INDENT>raise ValidationError(<EOL>'<STR_LIT:\n>'.join(<EOL>[<EOL>"<STR_LIT>".<EOL>format(depth, dimensions)<EOL>for depth, dimensions in invalid_depths_dimensions<EOL>]<EOL>)<EOL>)<EOL><DEDENT>dimensions = tuple(<EOL>toolz.first(set(dimensions))<EOL>for depth, dimensions in sorted(grouped_by_depth.items())<EOL>)<EOL>return dimensions<EOL>
Given an array type data item, check that it is an array and
return the dimensions as a tuple.
Ex: get_array_dimensions([[1, 2, 3], [4, 5, 6]]) returns (2, 3)