code: def test_tokens_to_indices_uses_pos_tags(self):
      tokens = self.tokenizer.split_words("This is a sentence.")
      tokens = [t for t in tokens] + [Token("</S>")]
      vocab = Vocabulary()
      root_index = vocab.add_token_to_namespace(
          "ROOT", namespace="dep_labels"
      )
      none_index = vocab.add_token_to_namespace(
          "NONE", namespace="dep_labels"
      )
      indexer = DepLabelIndexer()
      assert indexer.tokens_to_indices(
          [tokens[1]], vocab, "tokens1"
      ) == {"tokens1": [root_index]}
      assert indexer.tokens_to_indices(
          [tokens[-1]], vocab, "tokens-1"
      ) == {"tokens-1": [none_index]}
  
file_path: magnitude/pymagnitude/third_party/allennlp/tests/data/token_indexers/dep_label_indexer_test.py
imports: from __future__ import absolute_import
  from collections import defaultdict
  from allennlp.common.testing import AllenNlpTestCase
  from allennlp.data import Token, Vocabulary
  from allennlp.data.token_indexers import DepLabelIndexer
  from allennlp.data.tokenizers.word_splitter import SpacyWordSplitter
label_desc: Use image node_id 3 for calling the TestDepLabelIndexer obj's underlying member method code with example usage: obj.test_tokens_to_indices_uses_pos_tags() without return types