<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def when_matches(self, path, good_value, bad_values=None, timeout=None, event_timeout=None):
 """Resolve when an path value equals value Args: path (list):
 The path to wait to good_value (object):
 the value to wait for bad_values (list):
 values to raise an error on timeout (float):
 time in seconds to wait for responses, wait forever if None event_timeout: maximum time in seconds to wait between each response event, wait forever if None """

        future = self.when_matches_async(path, good_value, bad_values)
        self.wait_all_futures(
            future, timeout=timeout, event_timeout=event_timeout)