<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _drain(queue_to_drain, sentinel=None):
 """Remove all values from queue_to_drain and return as list. This uses the trick from http://stackoverflow.com/questions/ 1540822/dumping-a-multiprocessing-queue-into-a-list in order to ensure that the queue is fully drained. """

    queue_to_drain.put(sentinel)
    queued_items = [i for i in iter(queue_to_drain.get, None)]
    return queued_items