def _strip_to_only_final_name(self, summaries):
        """Removes all leading names in a summary

        Args:
            summaries: A `set` of `_ObservedSummary` values.

        Returns:
            A new `set` of `_ObservedSummary` values striped of all
            name except for the terminal one.

        """
        result = set()
        for s in summaries:
            if "/" not in s.tag:
                result.add(s)
            else:
                new_tag = s.tag.split("/")[-1]
                result.add(s._replace(tag=new_tag))
        return result
Removes all leading names in a summary

        Args:
            summaries: A `set` of `_ObservedSummary` values.

        Returns:
            A new `set` of `_ObservedSummary` values striped of all
            name except for the terminal one.

        
keras/src/callbacks/tensorboard_test.py