class_docstr: A `TokenIndexer` determines how string tokens get represented as arrays of indices in a model.
  This class both converts strings into numerical values, with the help of a
  :class:`~allennlp.data.vocabulary.Vocabulary`, and it produces actual arrays.
  
  Tokens can be represented as single IDs (e.g., the word "cat" gets represented by the number
  34), or as lists of character IDs (e.g., "cat" gets represented by the numbers [23, 10, 18]),
  or in some other way that you can come up with (e.g., if you have some structured input you
  want to represent in a special way in your data arrays, you can do that here).
  
  # Parameters
  
  token_min_padding_length : `int`, optional (default=`0`)
      The minimum padding length required for the :class:`TokenIndexer`. For example,
      the minimum padding length of :class:`SingleIdTokenIndexer` is the largest size of
      filter when using :class:`CnnEncoder`.
      Note that if you set this for one TokenIndexer, you likely have to set it for all
      :class:`TokenIndexer` for the same field, otherwise you'll get mismatched tensor sizes.
class_docstr_tok: ["A","`","TokenIndexer","`","determines","how","string","tokens","get","represented","as","arrays","of","indices","in","a","model",".","This","class","both","converts","strings","into","numerical","values",",","with","the","help","of","a",":","class",":","`","~allennlp.data.vocabulary.Vocabulary","`",",","and","it","produces","actual","arrays",".","Tokens","can","be","represented","as","single","IDs","(","e.g.",",","the","word","``","cat","''","gets","represented","by","the","number","34",")",",","or","as","lists","of","character","IDs","(","e.g.",",","``","cat","''","gets","represented","by","the","numbers","[","23",",","10",",","18","]",")",",","or","in","some","other","way","that","you","can","come","up","with","(","e.g.",",","if","you","have","some","structured","input","you","want","to","represent","in","a","special","way","in","your","data","arrays",",","you","can","do","that","here",")",".","#","Parameters","token_min_padding_length",":","`","int","`",",","optional","(","default=","`","0","`",")","The","minimum","padding","length","required","for","the",":","class",":","`","TokenIndexer","`",".","For","example",",","the","minimum","padding","length","of",":","class",":","`","SingleIdTokenIndexer","`","is","the","largest","size","of","filter","when","using",":","class",":","`","CnnEncoder","`",".","Note","that","if","you","set","this","for","one","TokenIndexer",",","you","likely","have","to","set","it","for","all",":","class",":","`","TokenIndexer","`","for","the","same","field",",","otherwise","you","'ll","get","mismatched","tensor","sizes","."]
docstr: This method returns a padding dictionary for the given `indexed_tokens` specifying all
  lengths that need padding.  If all you have is a list of single ID tokens, this is just the
  length of the list, and that's what the default implementation will give you.  If you have
  something more complicated, like a list of character ids for token, you'll need to override
  this.
docstr_tok: ["This","method","returns","a","padding","dictionary","for","the","given","`","indexed_tokens","`","specifying","all","lengths","that","need","padding",".","If","all","you","have","is","a","list","of","single","ID","tokens",",","this","is","just","the","length","of","the","list",",","and","that","'s","what","the","default","implementation","will","give","you",".","If","you","have","something","more","complicated",",","like","a","list","of","character","ids","for","token",",","you","'ll","need","to","override","this","."]
code: def get_padding_lengths(
      self, indexed_tokens: IndexedTokenList
  ) -> Dict[str, int]:
      """
      This method returns a padding dictionary for the given `indexed_tokens` specifying all
      lengths that need padding.  If all you have is a list of single ID tokens, this is just the
      length of the list, and that's what the default implementation will give you.  If you have
      something more complicated, like a list of character ids for token, you'll need to override
      this.
      """
      padding_lengths = {}
      for key, token_list in indexed_tokens.items():
          padding_lengths[key] = max(
              len(token_list), self._token_min_padding_length
          )
      return padding_lengths
  
file_path: allennlp/allennlp/data/token_indexers/token_indexer.py
imports: from typing import Any, Dict, List
  import torch
  from allennlp.common import Registrable
  from allennlp.common.util import pad_sequence_to_length
  from allennlp.data.tokenizers import Token
  from allennlp.data.vocabulary import Vocabulary
label_desc: Use image node_id 6 for calling the TokenIndexer obj's underlying member method code with example usage: obj.get_padding_lengths(indexed_tokens) and returns: padding_lengths