def get_bounds(locations, lonlat=False):
bounds = [[None, None], [None, None]]<EOL>for point in iter_coords(locations):<EOL><INDENT>bounds = [<EOL>[<EOL>none_min(bounds[<NUM_LIT:0>][<NUM_LIT:0>], point[<NUM_LIT:0>]),<EOL>none_min(bounds[<NUM_LIT:0>][<NUM_LIT:1>], point[<NUM_LIT:1>]),<EOL>],<EOL>[<EOL>none_max(bounds[<NUM_LIT:1>][<NUM_LIT:0>], point[<NUM_LIT:0>]),<EOL>none_max(bounds[<NUM_LIT:1>][<NUM_LIT:1>], point[<NUM_LIT:1>]),<EOL>],<EOL>]<EOL><DEDENT>if lonlat:<EOL><INDENT>bounds = _locations_mirror(bounds)<EOL><DEDENT>return bounds<EOL>
Computes the bounds of the object in the form
[[lat_min, lon_min], [lat_max, lon_max]]