class_docstr: A mapping from indices to vocab elements.
class_docstr_tok: ["A","mapping","from","indices","to","vocab","elements","."]
docstr: Look up a value or nested container of values in the vocab index.
  The return value will have the same shape as the input, with all values
  replaced with their respective indicies.
docstr_tok: ["Look","up","a","value","or","nested","container","of","values","in","the","vocab","index",".","The","return","value","will","have","the","same","shape","as","the","input",",","with","all","values","replaced","with","their","respective","indicies","."]
code: def lookup_all_internal(self, nested_values):
      """
      Look up a value or nested container of values in the vocab index.
      The return value will have the same shape as the input, with all values
      replaced with their respective indicies.
      """
  
      def lookup(value):
          if self.unk_token in self.idx:
              unk_idx = self.get_unk_index()
              v = self.idx.get(value, unk_idx)
              return v, 1 if v == unk_idx else 0, 1
          else:
              assert value in self.idx, (
                  f"Token '{value}' is missing from the Vocabulary,"
                  " and so is the fallback UNK token."
              )
              return self.idx[value], 0, 1
  
      if not should_iter(nested_values):
          return lookup(nested_values)
      else:
          indices = []
          unks = 0
          total = 0
          for value in nested_values:
              v, unk, t = self.lookup_all_internal(value)
              indices.append(v)
              unks += unk
              total += t
          return indices, unks, total
  
imports: import itertools
  from collections import Counter
  from typing import Dict, List, Optional, Tuple
  import torch
  from pytext.common.constants import SpecialTokens, Token
  from pytext.utils import cuda, precision
label_desc: Use image node_id 4 for calling the Vocabulary obj's underlying member method code with example usage: obj.lookup_all_internal(nested_values) and returns: lookup, indices,  unks,  total, v,  unknown,  int, self,  int,  int