code: def test_summary_name_conversion(self, scope):
      scoped_summary = _ScopedSummaryV2(
          self.test_subdirectory, scope=scope
      )
      c = tf.constant(3)
      scoped_summary.scalar("name with spaces", c)
      scoped_summary.scalar("name with many $#illegal^: characters!", c)
      scoped_summary.scalar("/name/with/leading/slash", c)
      self.write_summaries(scoped_summary)
      events = self.read_single_event_from_eventfile(scoped_summary)
      self.assertLen(events, 3)
      tags = [event.summary.value[0].tag for event in events]
      # Characters that were illegal in TF 1 are now valid in TF 2.
      self.assertIn("name with spaces", tags)
      self.assertIn("name with many $#illegal^: characters!", tags)
      self.assertIn("name/with/leading/slash", tags)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  import struct
  from absl.testing import parameterized
  from adanet import tf_compat
  from adanet.core import testing_utils
  from adanet.core.summary import _ScopedSummaryV2
  import tensorflow.compat.v2
  from tensorflow.python.eager import context
  from tensorflow.python.framework import test_util
label_desc: Use image node_id 9 for calling the ScopedSummaryV2Test obj's underlying member method code with example usage: obj.test_summary_name_conversion(scope) without return types