<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def clean(self, force: bool=False):
        '''Clean closed connections.

        Args:
            force: Clean connected and idle connections too.

        Coroutine.
        '''
        with (yield from self._lock):
            for connection in tuple(self.ready):
                if force or connection.closed():
                    connection.close()
                    self.ready.remove(connection)