code: def get_sample_based_on_metric_percentile(
      self, metric, percentile_start, percentile_end
  ):
      new_samples = None
      if self.data_1epoch_size is None:
          self.data_1epoch_size = sum(
              len(x) for x in self.curriculum_index_to_sample[metric]
          )
      max_percentile = self.data_efficiency_config[DATA_SAMPLING][
          CURRICULUM_LEARNING
      ][CURRICULUM_LEARNING_METRICS][metric][
          CURRICULUM_LEARNING_MAX_DIFFICULTY
      ]
      sample_per_percentile = self.data_1epoch_size // max_percentile
      start_count = sample_per_percentile * percentile_start
      end_count = sample_per_percentile * percentile_end
      if percentile_end == max_percentile:
          end_count = self.data_1epoch_size
      current_count = 0
      for row in range(len(self.curriculum_index_to_sample[metric])):
          row_size = len(self.curriculum_index_to_sample[metric][row])
          if current_count + row_size > start_count:
              row_start = max(0, start_count - current_count)
              if current_count + row_size <= end_count:
                  row_end = row_size
              else:
                  row_end = end_count - current_count
              row_samples = np.copy(
                  self.curriculum_index_to_sample[metric][row][
                      row_start:row_end
                  ]
              )
              new_samples = (
                  row_samples
                  if new_samples is None
                  else np.concatenate(
                      (new_samples, row_samples), axis=None
                  )
              )
          current_count += row_size
          if current_count >= end_count:
              break
      return new_samples
  
imports: import torch
  import os
  import numpy
  import deepspeed.comm
  from deepspeed.utils import logger
  from deepspeed.accelerator import get_accelerator
  from ..constants import *
  from ..curriculum_scheduler import CurriculumScheduler
  from .indexed_dataset import MMapIndexedDataset
  from .utils import create_mmap_dataset_builder, close_mmap_dataset_builder, find_fit_int_dtype
label_desc: Use image node_id 6 for calling the DeepSpeedDataSampler obj's underlying member method code with example usage: obj.get_sample_based_on_metric_percentile(metric, percentile_start, percentile_end) and returns: new_samples