code: def test_text_array_to_html(self):
      convert = lambda x: text_plugin.text_array_to_html(
          x, enable_markdown=True
      )
      scalar = np.array("foo")
      scalar_expected = "<p>foo</p>"
      self.assertEqual(convert(scalar), scalar_expected)
  
      # Check that underscores are preserved correctly; this detects erroneous
      # use of UTF-16 or UTF-32 encoding when calling markdown_to_safe_html(),
      # which would introduce spurious null bytes and cause undesired <em> tags
      # around the underscores.
      scalar_underscores = np.array("word_with_underscores")
      scalar_underscores_expected = "<p>word_with_underscores</p>"
      self.assertEqual(
          convert(scalar_underscores), scalar_underscores_expected
      )
  
      vector = np.array(["foo", "bar"])
      vector_expected = textwrap.dedent(
          """\
              <table>
              <tbody>
              <tr>
              <td><p>foo</p></td>
              </tr>
              <tr>
              <td><p>bar</p></td>
              </tr>
              </tbody>
              </table>
              """.rstrip()
      )
      self.assertEqual(convert(vector), vector_expected)
  
      d2 = np.array([["foo", "bar"], ["zoink", "zod"]])
      d2_expected = textwrap.dedent(
          """\
              <table>
              <tbody>
              <tr>
              <td><p>foo</p></td>
              <td><p>bar</p></td>
              </tr>
              <tr>
              <td><p>zoink</p></td>
              <td><p>zod</p></td>
              </tr>
              </tbody>
              </table>
              """.rstrip()
      )
      self.assertEqual(convert(d2), d2_expected)
  
      d3 = np.array(
          [
              [["foo", "bar"], ["zoink", "zod"]],
              [["FOO", "BAR"], ["ZOINK", "ZOD"]],
          ]
      )
  
      warning = plugin_util.markdown_to_safe_html(
          text_plugin.WARNING_TEMPLATE % 3
      )
      d3_expected = warning + textwrap.dedent(
          """\
              <table>
              <tbody>
              <tr>
              <td><p>foo</p></td>
              <td><p>bar</p></td>
              </tr>
              <tr>
              <td><p>zoink</p></td>
              <td><p>zod</p></td>
              </tr>
              </tbody>
              </table>
              """.rstrip()
      )
      self.assertEqual(convert(d3), d3_expected)
  
imports: import collections.abc
  import os
  import textwrap
  import numpy
  import tensorflow
  from tensorboard import plugin_util
  from tensorboard import context
  from tensorboard.backend.event_processing import data_provider
  from tensorboard.backend.event_processing import plugin_event_multiplexer
  from tensorboard.plugins import base_plugin
  from tensorboard.plugins.text import text_plugin
  from tensorboard.util import test_util
label_desc: Use image node_id 10 for calling the TextPluginTest obj's underlying member method code with example usage: obj.test_text_array_to_html() without return types