code: def embed_block(gpt_dataset, block, embedder):
      """Embed block of chunks."""
      text_block_dataset = torch.utils.data.Subset(
          GPTToTextDataset(gpt_dataset),
          range(*block["range"]),
      )
      return embedder.embed_text_dataset(text_block_dataset)
  
imports: import numpy
  import os
  import psutil
  import time
  import torch
  from tqdm import tqdm
  from megatron import get_retro_args, print_rank_0
  from tools.bert_embedding import BertEmbedder
  from tools.bert_embedding.utils import get_missing_blocks_by_rank
  from tools.retro.db.utils import get_merged_train_dataset
  from tools.retro.external_libs import faiss, h5py
  from tools.retro.index.factory import IndexFactory
  from tools.retro.index.utils import get_index_dir
  from tools.retro.utils import GPTToTextDataset
  from .chunk_dataset import get_chunk_dataset_map
label_desc: Use image node_id 2 for calling a global function with example usage: embed_block(gpt_dataset, block, embedder) and returns: embedder