def build(self, callable: Callable) -> Callable[..., CaptureResult]:
def capturing_callable(*args, **kwargs) -> CaptureResult:<EOL><INDENT>return CaptureResult(return_value=callable(*args, **kwargs))<EOL><DEDENT>if self.capture_exceptions:<EOL><INDENT>exceptions_wrapper = CaptureWrapBuilder._create_capture_exceptions(self.capture_exceptions)<EOL>capturing_callable = CaptureWrapBuilder._wrap(capturing_callable, exceptions_wrapper)<EOL><DEDENT>if self.capture_stdout:<EOL><INDENT>capturing_callable = CaptureWrapBuilder._wrap(capturing_callable, CaptureWrapBuilder._capture_stdout)<EOL><DEDENT>if self.capture_stderr:<EOL><INDENT>capturing_callable = CaptureWrapBuilder._wrap(capturing_callable, CaptureWrapBuilder._capture_stderr)<EOL><DEDENT>return capturing_callable<EOL>
Build a method that captures the required information when the given callable is called.
:param callable: the callable to capture information from
:return: the wrapped callable