class_docstr: Memory Augmented Time Series Dataset
  
  Args:
      handler (DataHandler): data handler
      segments (dict): data split segments
      seq_len (int): time series sequence length
      horizon (int): label horizon (to mask historical loss for TRA)
      num_states (int): how many memory states to be added (for TRA)
      batch_size (int): batch size (<0 means daily batch)
      shuffle (bool): whether shuffle data
      pin_memory (bool): whether pin data to gpu memory
      drop_last (bool): whether drop last batch < batch_size
class_docstr_tok: ["Memory","Augmented","Time","Series","Dataset","Args",":","handler","(","DataHandler",")",":","data","handler","segments","(","dict",")",":","data","split","segments","seq_len","(","int",")",":","time","series","sequence","length","horizon","(","int",")",":","label","horizon","(","to","mask","historical","loss","for","TRA",")","num_states","(","int",")",":","how","many","memory","states","to","be","added","(","for","TRA",")","batch_size","(","int",")",":","batch","size","(","<","0","means","daily","batch",")","shuffle","(","bool",")",":","whether","shuffle","data","pin_memory","(","bool",")",":","whether","pin","data","to","gpu","memory","drop_last","(","bool",")",":","whether","drop","last","batch","<","batch_size"]
code: def __init__(
      self,
      handler,
      segments,
      seq_len=60,
      horizon=0,
      num_states=1,
      batch_size=-1,
      shuffle=True,
      pin_memory=False,
      drop_last=False,
      **kwargs,
  ):
      assert (
          horizon > 0
      ), "please specify `horizon` to avoid data leakage"
  
      self.seq_len = seq_len
      self.horizon = horizon
      self.num_states = num_states
      self.batch_size = batch_size
      self.shuffle = shuffle
      self.drop_last = drop_last
      self.pin_memory = pin_memory
      self.params = (
          batch_size,
          drop_last,
          shuffle,
      )  # for train/eval switch
  
      super().__init__(handler, segments, **kwargs)
  
imports: import copy
  import torch
  import numpy
  import pandas
  from qlib.data.dataset import DatasetH
label_desc: Use image node_id 1 to create a new MTSDatasetH object from inherited base classes: DatasetH with example: obj = MTSDatasetH(handler, segments, seq_len, horizon, num_states, batch_size, shuffle, pin_memory, drop_last)