code: def test_read_from_json_replaces_newlines(self):
      # The csv -> tsv conversion renders '\n' as r'\n' (with a literal slash character), that
      # gets read in a two characters instead of one.  We need to make sure we convert it back to
      # one newline character, so our splitting and other processing works correctly.
      json = {
          "question": [
              Token(x) for x in ["where", "is", "mersin", "?"]
          ],
          "columns": ["Name\\nin English", "Location"],
          "cells": [["Paradeniz", "Mersin"], ["Lake\\nGala", "Edirne"]],
      }
      graph = TableQuestionKnowledgeGraph.read_from_json(json)
      assert graph.entities == [
          "-1",
          "0",
          "1",
          "fb:cell.edirne",
          "fb:cell.lake_gala",
          "fb:cell.mersin",
          "fb:cell.paradeniz",
          "fb:part.gala",
          "fb:part.lake",
          "fb:part.paradeniz",
          "fb:row.row.location",
          "fb:row.row.name_in_english",
      ]
      assert (
          graph.entity_text["fb:row.row.name_in_english"]
          == "Name\nin English"
      )
  
imports: from __future__ import absolute_import
  from allennlp.common.testing import AllenNlpTestCase
  from allennlp.data import Token
  from allennlp.semparse.contexts import TableQuestionKnowledgeGraph
label_desc: Use image node_id 2 for calling the TestTableQuestionKnowledgeGraph obj's underlying member method code with example usage: obj.test_read_from_json_replaces_newlines() without return types