def validate_locations(locations):
locations = if_pandas_df_convert_to_numpy(locations)<EOL>try:<EOL><INDENT>iter(locations)<EOL><DEDENT>except TypeError:<EOL><INDENT>raise TypeError('<STR_LIT>'<EOL>'<STR_LIT>'.format(locations))<EOL><DEDENT>try:<EOL><INDENT>next(iter(locations))<EOL><DEDENT>except StopIteration:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>try:<EOL><INDENT>float(next(iter(next(iter(next(iter(locations)))))))<EOL><DEDENT>except (TypeError, StopIteration):<EOL><INDENT>return [validate_location(coord_pair) for coord_pair in locations]<EOL><DEDENT>else:<EOL><INDENT>return [validate_locations(lst) for lst in locations]<EOL><DEDENT>
Validate an iterable with multiple lat/lon coordinate pairs.

    Returns
    -------
    list[list[float, float]] or list[list[list[float, float]]]