def fetch_buffer(self, *, timeout=<NUM_LIT:0>, is_raw=False):
if not self.is_acquiring_images:<EOL><INDENT>raise TimeoutException<EOL><DEDENT>watch_timeout = True if timeout > <NUM_LIT:0> else False<EOL>buffer = None<EOL>base = time.time()<EOL>while buffer is None:<EOL><INDENT>if watch_timeout and (time.time() - base) > timeout:<EOL><INDENT>raise TimeoutException<EOL><DEDENT>else:<EOL><INDENT>with MutexLocker(self.thread_image_acquisition):<EOL><INDENT>if len(self._holding_filled_buffers) > <NUM_LIT:0>:<EOL><INDENT>if is_raw:<EOL><INDENT>buffer = self._holding_filled_buffers.pop(<NUM_LIT:0>)<EOL><DEDENT>else:<EOL><INDENT>_buffer = self._holding_filled_buffers.pop(<NUM_LIT:0>)<EOL>self._update_chunk_data(buffer=_buffer)<EOL>buffer = Buffer(<EOL>buffer=_buffer,<EOL>node_map=self.device.node_map,<EOL>logger=self._logger<EOL>)<EOL><DEDENT><DEDENT><DEDENT><DEDENT><DEDENT>if _is_logging_buffer_manipulation:<EOL><INDENT>self._logger.debug(<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT:.>'.format(<EOL>buffer._buffer.context,<EOL>buffer._buffer.frame_id,<EOL>buffer._buffer.parent.id_,<EOL>buffer._buffer.parent.parent.id_<EOL>)<EOL>)<EOL><DEDENT>return buffer<EOL>
Fetches the latest :class:`Buffer` object and returns it.

:param timeout: Set timeout value in second.
:param is_raw: Set :const:`True` if you need a raw GenTL Buffer module.

:return: A :class:`Buffer` object.