    def extend_from_vocab(self, vocab: "Vocabulary") -> None:
        """
        Adds all vocabulary items from all namespaces in the given vocabulary to this vocabulary.
        Useful if you want to load a model and extends its vocabulary from new instances.

        We also add all non-padded namespaces from the given vocabulary to this vocabulary.
        """
        self._non_padded_namespaces.update(vocab._non_padded_namespaces)
        self._token_to_index._non_padded_namespaces.update(vocab._non_padded_namespaces)
        self._index_to_token._non_padded_namespaces.update(vocab._non_padded_namespaces)
        for namespace in vocab.get_namespaces():
            for token in vocab.get_token_to_index_vocabulary(namespace):
                self.add_token_to_namespace(token, namespace)
Adds all vocabulary items from all namespaces in the given vocabulary to this vocabulary.
Useful if you want to load a model and extends its vocabulary from new instances.

We also add all non-padded namespaces from the given vocabulary to this vocabulary.
allennlp/data/vocabulary.py