def _fix_twisted_logs(self, detailed, detail_name):
        twisted_log = detailed.getDetails()[detail_name]
        split_logs = [None]

        def _get_split_logs():
            # Memoize the split log so we don't iterate through it twice.
            if split_logs[0] is None:
                split_logs[0] = _split_map_maybe(
                    extract_eliot_from_twisted_log,
                    _iter_content_lines(twisted_log),
                )
            return split_logs[0]

        # The trick here is that we can't iterate over the base detail yet.
        # We can only use it inside the iter_bytes of the Content objects
        # that we add. This is because the only time that we *know* the
        # details are populated is when the details are evaluated. If we call
        # it in _setUp(), the logs are empty. If we call it in cleanup, the
        # detail is gone.

        detailed.addDetail(
            detail_name,
            Content(UTF8_TEXT, lambda: _get_split_logs()[0]))

        detailed.addDetail(
            self._ELIOT_LOG_DETAIL_NAME,
            Content(
                UTF8_TEXT, lambda: _prettyformat_lines(_get_split_logs()[1])))
Return the extension trait with the specifed Id.
dataset/ETHPy150Open ClusterHQ/flocker/flocker/testtools/_base.py/_SplitEliotLogs._fix_twisted_logs--crossover with--dataset/ETHPy150Open enthought/envisage/envisage/developer/ui/view/extension_registry_browser.py/ExtensionRegistryBrowser._get_extension_trait