code: def test_from_params(self):
      # pylint: disable=protected-access
      params = Params({"use_subtrees": True, "granularity": "5-class"})
      reader = StanfordSentimentTreeBankDatasetReader.from_params(
          params
      )
      assert reader._use_subtrees is True
      assert reader._granularity == "5-class"
  
file_path: magnitude/pymagnitude/third_party/allennlp/tests/data/dataset_readers/stanford_sentiment_tree_bank_test.py
imports: from __future__ import division
  from __future__ import absolute_import
  import pytest
  from allennlp.data.dataset_readers import StanfordSentimentTreeBankDatasetReader
  from allennlp.common import Params
  from allennlp.common.util import ensure_list
  from allennlp.common.testing import AllenNlpTestCase
label_desc: Use image node_id 5 for calling the TestStanfordSentimentTreebankReader obj's underlying member method code with example usage: obj.test_from_params() without return types