class_docstr: Load dataset with COCO format.
  
  Args:
      dataset_dir (str): root directory for dataset.
      image_dir (str): directory for images.
      anno_path (str): coco annotation file path.
      data_fields (list): key name of data dictionary, at least have 'image'.
      sample_num (int): number of samples to load, -1 means all.
      load_crowd (bool): whether to load crowded ground-truth. 
          False as default
      allow_empty (bool): whether to load empty entry. False as default
      empty_ratio (float): the ratio of empty record number to total 
          record's, if empty_ratio is out of [0. ,1.), do not sample the 
          records and use all the empty entries. 1. as default
      repeat (int): repeat times for dataset, use in benchmark.
code: def _sample_empty(self, records, num):
      # if empty_ratio is out of [0. ,1.), do not sample the records
      if self.empty_ratio < 0.0 or self.empty_ratio >= 1.0:
          return records
      import random
  
      sample_num = min(
          int(num * self.empty_ratio / (1 - self.empty_ratio)),
          len(records),
      )
      records = random.sample(records, sample_num)
      return records
  
imports: import os
  import copy
  import numpy
  from ppdet.core.workspace import register, serializable
  from .dataset import DetDataset
  from ppdet.utils.logger import setup_logger
label_desc: Use image node_id 2 for calling the COCODataSet obj's underlying member method code with example usage: obj._sample_empty(records, num) and returns: records, records