code: def test_train_resume_language_model(
      resources_path, results_base_path, tasks_base_path
  ):
      # get default dictionary
      dictionary: Dictionary = Dictionary.load("chars")
  
      # init forward LM with 128 hidden states and 1 layer
      language_model: LanguageModel = LanguageModel(
          dictionary, is_forward_lm=True, hidden_size=128, nlayers=1
      )
  
      # get the example corpus and process at character level in forward direction
      corpus: TextCorpus = TextCorpus(
          resources_path / "corpora/lorem_ipsum",
          dictionary,
          language_model.is_forward_lm,
          character_level=True,
      )
  
      # train the language model
      trainer: LanguageModelTrainer = LanguageModelTrainer(
          language_model, corpus, test_mode=True
      )
      trainer.train(
          results_base_path,
          sequence_length=10,
          mini_batch_size=10,
          max_epochs=2,
          checkpoint=True,
      )
      del trainer, language_model
  
      trainer = LanguageModelTrainer.load_checkpoint(
          results_base_path / "checkpoint.pt", corpus
      )
      trainer.train(
          results_base_path,
          sequence_length=10,
          mini_batch_size=10,
          max_epochs=2,
      )
  
      del trainer
  
file_path: flair/tests/test_language_model.py
imports: import pytest
  from flair.data import Dictionary, Sentence
  from flair.embeddings import FlairEmbeddings, TokenEmbeddings
  from flair.models import LanguageModel
  from flair.trainers.language_model_trainer import LanguageModelTrainer, TextCorpus
label_desc: Use image node_id 2 for calling a global function with example usage: test_train_resume_language_model(resources_path, results_base_path, tasks_base_path) without return types