<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def context_exists(self, name):
 """Check if a given context exists."""

        contexts = self.data['contexts']
        for context in contexts:
            if context['name'] == name:
                return True
        return False