def _test_formatFlatEvent_fieldNamesSame(self, event=None):
        """
        The same format field used twice in one event is rendered twice.

        @param event: An event to flatten.  If L{None}, create a new event.
        @return: C{event} or the event created.
        """
        if event is None:
            counter = count()

            class CountStr(object):
                """
                Hack
                """
                def __str__(self):
                    return str(next(counter))

            event = dict(
                log_format="{x} {x}",
                x=CountStr(),
            )

        flattenEvent(event)
        self.assertEqual(formatEvent(event), u"0 1")

        return event

        The same format field used twice in one event is rendered twice.

        @param event: An event to flatten.  If L{None}, create a new event.
        @return: C{event} or the event created.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/logger/test/test_flatten.py