code: def __init__(
      self,
      manifest,
      dictionary,
      dur_dictionary,
      f0_dictionary,
      config,
      discrete_dur,
      discrete_f0,
      log_f0,
      normalize_f0_mean,
      normalize_f0_std,
      interpolate_f0,
      return_filename=False,
      strip_filename=True,
      shifts="0,0",
      return_continuous_f0=False,
  ):
      random.seed(1234)
      self.dictionary = dictionary
      self.dur_dictionary = dur_dictionary
      self.f0_dictionary = f0_dictionary
      self.config = config
  
      # duration config
      self.discrete_dur = discrete_dur
  
      # pitch config
      self.discrete_f0 = discrete_f0
      self.log_f0 = log_f0
      self.normalize_f0_mean = normalize_f0_mean
      self.normalize_f0_std = normalize_f0_std
      self.interpolate_f0 = interpolate_f0
  
      self.return_filename = return_filename
      self.strip_filename = strip_filename
      self.f0_code_ratio = config.code_hop_size / (
          config.sampling_rate * F0_FRAME_SPACE
      )
  
      # use lazy loading to avoid sharing file handlers across workers
      self.manifest = manifest
      self._codes = None
      self._durs = None
      self._f0s = None
      with open(f"{manifest}.leng.txt", "r") as f:
          lengs = [int(line.rstrip()) for line in f]
          edges = np.cumsum([0] + lengs)
          self.starts, self.ends = edges[:-1], edges[1:]
      with open(f"{manifest}.path.txt", "r") as f:
          self.file_names = [line.rstrip() for line in f]
      logger.info(f"num entries: {len(self.starts)}")
  
      if os.path.exists(f"{manifest}.f0_stat.pt"):
          self.f0_stats = torch.load(f"{manifest}.f0_stat.pt")
      elif config.f0_stats:
          self.f0_stats = torch.load(config.f0_stats)
  
      self.multispkr = config.multispkr
      if config.multispkr:
          with open(f"{manifest}.speaker.txt", "r") as f:
              self.spkrs = [line.rstrip() for line in f]
          self.id_to_spkr = sorted(self.spkrs)
          self.spkr_to_id = {
              k: v for v, k in enumerate(self.id_to_spkr)
          }
  
      self.pads = Paddings(
          dictionary.pad(),
          0,  # use 0 for duration padding
          f0_dictionary.pad() if discrete_f0 else -5.0,
      )
      self.shifts = Shifts(shifts, pads=self.pads)
      self.return_continuous_f0 = return_continuous_f0
  
imports: import json
  import logging
  import os
  import random
  from pathlib import Path
  import numpy
  import torch
  import torch.utils.data
  from .None import data_utils
  from fairseq.data.fairseq_dataset import FairseqDataset
label_desc: Use image node_id 1 to create a new CodeDataset object from inherited base classes: FairseqDataset with example: obj = CodeDataset(manifest, dictionary, dur_dictionary, f0_dictionary, config, discrete_dur, discrete_f0, log_f0, normalize_f0_mean, normalize_f0_std, interpolate_f0, return_filename, strip_filename, shifts, return_continuous_f0)