code: def test_tokens_to_indices_with_non_default_feature_name(self):
      tokenizer = SpacyTokenizer(parse=True)
      tokens = tokenizer.tokenize("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 = SingleIdTokenIndexer(
          namespace="dep_labels",
          feature_name="dep_",
          default_value="NONE",
      )
      assert indexer.tokens_to_indices([tokens[1]], vocab) == {
          "tokens": [root_index]
      }
      assert indexer.tokens_to_indices([tokens[-1]], vocab) == {
          "tokens": [none_index]
      }
  
imports: from collections import defaultdict
  from dataclasses import dataclass
  import pytest
  from allennlp.common.testing import AllenNlpTestCase
  from allennlp.data import Token, Vocabulary
  from allennlp.data.token_indexers import SingleIdTokenIndexer
  from allennlp.data.tokenizers import SpacyTokenizer
label_desc: Use image node_id 5 for calling the TestSingleIdTokenIndexer obj's underlying member method code with example usage: obj.test_tokens_to_indices_with_non_default_feature_name() without return types