Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _excavate_unrequited_love_cases(self):
"""Recognize cases where one character's love for another is not reciprocated."""
unrequited_love_cases = []
for first_person in self.simulation.town.residents:
first_person_love_interests = set(first_person.is_captivated_by)
for second_person in first_person_love_interests:
second_person_love_interests = set(second_person.is_captivated_by)
if first_person not in second_person_love_interests:
unrequited_love_cases.append(UnrequitedLove(subjects=(first_person, second_person)))
return unrequited_love_cases