class_docstr: This :class:`TokenIndexer` represents tokens as single integers.
  
  Registered as a `TokenIndexer` with name "single_id".
  
  # Parameters
  
  namespace : `Optional[str]`, optional (default=`"tokens"`)
      We will use this namespace in the :class:`Vocabulary` to map strings to indices.  If you
      explicitly pass in `None` here, we will skip indexing and vocabulary lookups.  This means
      that the `feature_name` you use must correspond to an integer value (like `text_id`, for
      instance, which gets set by some tokenizers, such as when using byte encoding).
  lowercase_tokens : `bool`, optional (default=`False`)
      If `True`, we will call `token.lower()` before getting an index for the token from the
      vocabulary.
  start_tokens : `List[str]`, optional (default=`None`)
      These are prepended to the tokens provided to `tokens_to_indices`.
  end_tokens : `List[str]`, optional (default=`None`)
      These are appended to the tokens provided to `tokens_to_indices`.
  feature_name : `str`, optional (default=`"text"`)
      We will use the :class:`Token` attribute with this name as input.  This is potentially
      useful, e.g., for using NER tags instead of (or in addition to) surface forms as your inputs
      (passing `ent_type_` here would do that).  If you use a non-default value here, you almost
      certainly want to also change the `namespace` parameter, and you might want to give a
      `default_value`.
  default_value : `str`, optional
      When you want to use a non-default `feature_name`, you sometimes want to have a default
      value to go with it, e.g., in case you don't have an NER tag for a particular token, for
      some reason.  This value will get used if we don't find a value in `feature_name`.  If this
      is not given, we will crash if a token doesn't have a value for the given `feature_name`, so
      that you don't get weird, silent errors by default.
  token_min_padding_length : `int`, optional (default=`0`)
      See :class:`TokenIndexer`.
class_docstr_tok: ["This",":","class",":","`","TokenIndexer","`","represents","tokens","as","single","integers",".","Registered","as","a","`","TokenIndexer","`","with","name","``","single_id","''",".","#","Parameters","namespace",":","`","Optional","[","str","]","`",",","optional","(","default=","`","``","tokens","''","`",")","We","will","use","this","namespace","in","the",":","class",":","`","Vocabulary","`","to","map","strings","to","indices",".","If","you","explicitly","pass","in","`","None","`","here",",","we","will","skip","indexing","and","vocabulary","lookups",".","This","means","that","the","`","feature_name","`","you","use","must","correspond","to","an","integer","value","(","like","`","text_id","`",",","for","instance",",","which","gets","set","by","some","tokenizers",",","such","as","when","using","byte","encoding",")",".","lowercase_tokens",":","`","bool","`",",","optional","(","default=","`","False","`",")","If","`","True","`",",","we","will","call","`","token.lower","(",")","`","before","getting","an","index","for","the","token","from","the","vocabulary",".","start_tokens",":","`","List","[","str","]","`",",","optional","(","default=","`","None","`",")","These","are","prepended","to","the","tokens","provided","to","`","tokens_to_indices","`",".","end_tokens",":","`","List","[","str","]","`",",","optional","(","default=","`","None","`",")","These","are","appended","to","the","tokens","provided","to","`","tokens_to_indices","`",".","feature_name",":","`","str","`",",","optional","(","default=","`","``","text","''","`",")","We","will","use","the",":","class",":","`","Token","`","attribute","with","this","name","as","input",".","This","is","potentially","useful",",","e.g.",",","for","using","NER","tags","instead","of","(","or","in","addition","to",")","surface","forms","as","your","inputs","(","passing","`","ent_type_","`","here","would","do","that",")",".","If","you","use","a","non-default","value","here",",","you","almost","certainly","want","to","also","change","the","`","namespace","`","parameter",",","and","you","might","want","to","give","a","`","default_value","`",".","default_value",":","`","str","`",",","optional","When","you","want","to","use","a","non-default","`","feature_name","`",",","you","sometimes","want","to","have","a","default","value","to","go","with","it",",","e.g.",",","in","case","you","do","n't","have","an","NER","tag","for","a","particular","token",",","for","some","reason",".","This","value","will","get","used","if","we","do","n't","find","a","value","in","`","feature_name","`",".","If","this","is","not","given",",","we","will","crash","if","a","token","does","n't","have","a","value","for","the","given","`","feature_name","`",",","so","that","you","do","n't","get","weird",",","silent","errors","by","default",".","token_min_padding_length",":","`","int","`",",","optional","(","default=","`","0","`",")","See",":","class",":","`","TokenIndexer","`","."]
code: def count_vocab_items(
      self, token: Token, counter: Dict[str, Dict[str, int]]
  ):
      if self.namespace is not None:
          text = self._get_feature_value(token)
          if self.lowercase_tokens:
              text = text.lower()
          counter[self.namespace][text] += 1
  
file_path: allennlp/allennlp/data/token_indexers/single_id_token_indexer.py
imports: from typing import Dict, List, Optional, Any
  import itertools
  from allennlp.data.vocabulary import Vocabulary
  from allennlp.data.tokenizers import Token
  from allennlp.data.token_indexers.token_indexer import TokenIndexer, IndexedTokenList
label_desc: Use image node_id 2 for calling the SingleIdTokenIndexer obj's underlying member method code with example usage: obj.count_vocab_items(token, counter) without return types