#!/usr/bin/env python3
"""Auto-generated by AGI Loop cycle #1206
Task: \
</think>

Write a Python function that takes a list of dictionaries representing episodes and returns the episode with the highest emotional peak value.
Generated: 2026-02-13T00:05:06.052694
"""

def find_episode_with_highest_peak(episodes):
    if not episodes:
        return None
    max_peak = -float('inf')
    max_episode = None
    for episode in episodes:
        if 'emotional_peak' in episode and episode['emotional_peak'] > max_peak:
            max_peak = episode['emotional_peak']
            max_episode = episode
    return max_episode

if __name__ == '__main__':
    episodes = [
        {'title': 'Episode 1', 'emotional_peak': 7.5},
        {'title': 'Episode 2', 'emotional_peak': 8.9},
        {'title': 'Episode 3', 'emotional_peak': 6.2},
        {'title': 'Episode 4', 'emotional_peak': 9.5},
        {'title': 'Episode 5', 'emotional_peak': 8.1}
    ]
    result = find_episode_with_highest_peak(episodes)
    if result:
        print(f"Episode with highest emotional peak: {result['title']}, Peak: {result['emotional_peak']}")
    else:
        print("No episodes found.")