Given an existing code base, implement the data transformation code and generate the possible KPIs, using AI tools and explaining how you use them
Asked in the AI coding round stage. Full AI access; evaluation includes both the implementation and how effectively you use and verify AI assistance.
Implement transform_and_generate_kpis(records). Each record is a dictionary with timestamp as an ISO string, user_id, event, and numeric value. Return {"records": transformed_records, "kpis": kpis}. Add day from the first 10 timestamp characters and normalize event with trimming and lowercase. KPIs must include total events, unique users, total value, average value rounded to two decimals, counts by event, and counts by day.
def transform_and_generate_kpis(records):