code: def __init__(self, data_path, params, no_targets=False):
      print("🏝 Loading Dataset at", data_path)
      self.costs = params.costs
      self.no_targets = no_targets
      # Load files
      datas = {}
      if not os.listdir(data_path):
          raise ValueError("Empty data_path")
      numpy_files_found = False
      print("Reading ", end="")
      for file_name in os.listdir(data_path):
          if not ".npy" in file_name:
              continue
          numpy_files_found = True
          print(file_name, end=", ")
          datas[file_name.split(".")[0]] = np.load(
              data_path + file_name,
              mmap_mode="r" if params.lazy else None,
          )
      if not numpy_files_found:
          raise ValueError(f"Can't find numpy files in {data_path}")
  
      # Gather arrays in two lists of tuples for mention and pairs
      if not params.lazy:
          self.mentions = list(
              zip(
                  *(
                      arr
                      for key, arr in sorted(datas.items())
                      if key.startswith("mentions")
                  )
              )
          )
          self.pairs = list(
              zip(
                  *(
                      arr
                      for key, arr in sorted(datas.items())
                      if key.startswith("pairs")
                  )
              )
          )
      else:
          self.mentions = _DictionaryDataLoader(
              datas,
              order=(
                  "mentions_features",
                  "mentions_labels",
                  "mentions_pairs_length",
                  "mentions_pairs_start_index",
                  "mentions_spans",
                  "mentions_words",
              ),
          )
          self.pairs = _DictionaryDataLoader(
              datas,
              order=(
                  "pairs_ant_index",
                  "pairs_features",
                  "pairs_labels",
              ),
          )
  
      self.mentions_pair_length = datas[FEATURES_NAMES[2]]
      assert [arr.shape[0] for arr in self.mentions[0]] == [
          6,
          1,
          1,
          1,
          250,
          8,
      ]  # Cf order of FEATURES_NAMES in conllparser.py
      assert [arr.shape[0] for arr in self.pairs[0]] == [
          1,
          9,
          1,
      ]
  
imports: import os
  import io
  import numpy
  import torch
  import torch.utils.data
  from torch.utils.data.sampler import Sampler
  from torch.utils.data import Dataset
  from neuralcoref.train.utils import encode_distance, BATCH_SIZE_PATH, SIZE_FP, SIZE_FP_COMPRESSED, SIZE_FS, SIZE_FS_COMPRESSED, SIZE_GENRE, SIZE_PAIR_IN, SIZE_SINGLE_IN
  from neuralcoref.train.conllparser import FEATURES_NAMES
label_desc: Use image node_id 1 to create a new NCDataset object from inherited base classes: Dataset with example: obj = NCDataset(data_path, params, no_targets)