def get_tasks(self, count):
tasks = []<EOL>for i in range(<NUM_LIT:0>, count):<EOL><INDENT>try:<EOL><INDENT>x = self.pending_task_queue.get(block=False)<EOL><DEDENT>except queue.Empty:<EOL><INDENT>break<EOL><DEDENT>else:<EOL><INDENT>tasks.append(x)<EOL><DEDENT><DEDENT>return tasks<EOL>
Obtains a batch of tasks from the internal pending_task_queue

        Parameters
        ----------
        count: int
            Count of tasks to get from the queue

        Returns
        -------
        List of upto count tasks. May return fewer than count down to an empty list
            eg. [{'task_id':<x>, 'buffer':<buf>} ... ]