code: def __len__(self):
      return self.total_samples
  
file_path: ColossalAI/examples/tutorial/sequence_parallel/data/datasets/data_samplers.py
imports: import torch
  from colossalai.legacy.context import ParallelMode
  from colossalai.legacy.core import global_context
label_desc: Use image node_id 2 for calling the MegatronPretrainingSampler obj's underlying member method code with example usage: obj.__len__() and returns: self