<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def put(self, task, args, kwargs):
 """ Add a new item to the queue. An item is a task and the arguments needed to call it. Do not call this directly, use Task.queue/Task.run instead. """

        if self.num_threads == 0:
            return task(*args, **kwargs)
        if self.queue is None:
            self._spawn()
        self.queue.put((task, args, kwargs))