class_docstr: The base GPT dataset
  
  Args:
      indexed_dataset (MMapIndexedDataset): The MMapIndexedDataset around which to build the
      MegatronDataset
  
      indexed_indices (numpy.ndarray): The set of the documents indices to expose
  
      num_samples (int): The number of samples to draw from the indexed dataset
  
      index_split (Split): The indexed_indices Split
  
      config (GPTDatasetConfig): The GPT-specific container for all config sourced parameters
class_docstr_tok: ["The","base","GPT","dataset","Args",":","indexed_dataset","(","MMapIndexedDataset",")",":","The","MMapIndexedDataset","around","which","to","build","the","MegatronDataset","indexed_indices","(","numpy.ndarray",")",":","The","set","of","the","documents","indices","to","expose","num_samples","(","int",")",":","The","number","of","samples","to","draw","from","the","indexed","dataset","index_split","(","Split",")",":","The","indexed_indices","Split","config","(","GPTDatasetConfig",")",":","The","GPT-specific","container","for","all","config","sourced","parameters"]
docstr: Calculate the number of epochs
  
  Args:
      num_tokens_per_epoch (int): The number of tokens in a single epoch
  
  Returns:
      int: The number of epochs
docstr_tok: ["Calculate","the","number","of","epochs","Args",":","num_tokens_per_epoch","(","int",")",":","The","number","of","tokens","in","a","single","epoch","Returns",":","int",":","The","number","of","epochs"]
code: def _get_num_epochs(self, num_tokens_per_epoch: int) -> int:
      """Calculate the number of epochs
  
      Args:
          num_tokens_per_epoch (int): The number of tokens in a single epoch
  
      Returns:
          int: The number of epochs
      """
      num_epochs = 0
      num_tokens = 0
      num_tokens_requested = (
          self.num_samples * self.config.sequence_length
      ) + 1
      while True:
          num_epochs += 1
          num_tokens += num_tokens_per_epoch
          if num_tokens >= num_tokens_requested:
              return num_epochs
  
imports: import logging
  import os
  import time
  from dataclasses import dataclass
  from typing import Dict, Tuple, Union
  import numpy
  import torch
  from megatron.core.datasets.blended_megatron_dataset_config import BlendedMegatronDatasetConfig
  from megatron.core.datasets.indexed_dataset import MMapIndexedDataset
  from megatron.core.datasets.megatron_dataset import MegatronDataset
  from megatron.core.datasets.utils import Split, log_single_rank
label_desc: Use image node_id 10 for calling the GPTDataset obj's underlying member method code with example usage: obj._get_num_epochs(num_tokens_per_epoch) and returns: num_epochs