def pad_to_vocab_size(self, n):
    """Force the maximum vocabulary size to be n.

    Args:
      n: a positive integer

    Raises:
      IndexError: When n is smaller than the existing vocabulary size.
    """
    if n < self._next_id:
      raise IndexError(
          'Cannot reduce vocabulary from %d to %d' % (self._next_id, n))
    tmp = self._next_id
    self._next_id = tmp
    self._vocab_size = n
Force the maximum vocabulary size to be n.

    Args:
      n: a positive integer

    Raises:
      IndexError: When n is smaller than the existing vocabulary size.
    
language/nql/nql/symbol.py