code: def test_t5_resize_token_embeddings(
      model: T5, tie_word_embeddings: bool
  ):
      module = T5(tie_word_embeddings=tie_word_embeddings)
  
      labels = torch.IntTensor([[1, 2, 3]])
      module(torch.IntTensor([[129, 130, 131]]), labels=labels)
      module.resize_token_embeddings(128)
      with pytest.raises(IndexError):
          module(torch.IntTensor([[129, 130, 131]]), labels=labels)
      module.resize_token_embeddings(1024)
      module(torch.IntTensor([[129, 130, 131]]), labels=labels)
  
file_path: allennlp/tests/modules/transformer/t5_test.py
imports: import pytest
  import torch
  from transformers.models import t5
  from allennlp.modules.transformer.t5 import T5
  from allennlp.nn.parallel import FairScaleFsdpAccelerator
  from allennlp.common.testing import run_distributed_test, requires_multi_gpu
label_desc: Use image node_id 10 for calling a global function with example usage: test_t5_resize_token_embeddings(model, tie_word_embeddings) without return types