Build a function to parse and filter a large stream of vessel location data for Kpler.
Implement parse_and_filter_locations(chunks, vessel_ids, start_time, end_time, bounds). chunks is a list of string fragments containing newline-delimited records in the form vessel_id,timestamp,latitude,longitude; records may be split across fragments. Return a list of valid matching records in input order. Ignore malformed records, unknown vessels, non-finite coordinates, timestamps outside the inclusive range, and coordinates outside the inclusive latitude/longitude bounds. The final record may not end with a newline.
Example: ['IMO1,100,51.5,-0.1 IMO2,101,40.7,-74.0 '], ['IMO1'], 100, 100, [50, 52, -1, 1] returns [{'vessel_id': 'IMO1', 'timestamp': 100, 'latitude': 51.5, 'longitude': -0.1}].
def parse_and_filter_locations(chunks, vessel_ids, start_time, end_time, bounds):