class_docstr: This :class:`TokenIndexer` represents tokens by their part of speech tag, as determined by
  the ``pos_`` or ``tag_`` fields on ``Token`` (corresponding to spacy's coarse-grained and
  fine-grained POS tags, respectively).
  
  Parameters
  ----------
  namespace : ``str``, optional (default=``pos_tags``)
      We will use this namespace in the :class:`Vocabulary` to map strings to indices.
  coarse_tags : ``bool``, optional (default=``False``)
      If ``True``, we will use coarse POS tags instead of the default fine-grained POS tags.
code: def tokens_to_indices(self, tokens, vocabulary, index_name):
      tags = []
  
      for token in tokens:
          if self._coarse_tags:
              tag = token.pos_
          else:
              tag = token.tag_
          if tag is None:
              tag = "NONE"
  
          tags.append(tag)
  
      return {
          index_name: [
              vocabulary.get_token_index(tag, self._namespace)
              for tag in tags
          ]
      }
  
file_path: magnitude/pymagnitude/third_party/allennlp/data/token_indexers/pos_tag_indexer.py
imports: from __future__ import absolute_import
  import logging
  from allennlp.common.util import pad_sequence_to_length
  from allennlp.data.vocabulary import Vocabulary
  from allennlp.data.tokenizers.token import Token
  from allennlp.data.token_indexers.token_indexer import TokenIndexer
label_desc: Use image node_id 3 for calling the PosTagIndexer obj's underlying member method code with example usage: obj.tokens_to_indices(tokens, vocabulary, index_name) and returns: dict