<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def wait_running(self, timeout=None):
 """Wait for the thread to pass control to its routine. Args: timeout (float):
 The maximum amount of time to wait """


        flag = self._running.wait(timeout)

        if flag is False:
            raise TimeoutExpiredError("Timeout waiting for thread to start running")