<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def set_max_threads(self, max_threads):
 """ Set the maximum number of concurrent threads. :type max_threads: int :param max_threads: The number of threads. """

        if max_threads is None:
            raise TypeError('max_threads must not be None.')
        self._check_if_ready()
        self.collection.set_max_working(max_threads)