code: def __init__(
      self,
      instances: List[TimeSeries],
      scopes: Optional[List[Tuple[int, slice]]] = None,
      categorical_encoders: Optional[defaultdict] = None,
      numerical_encoders: Optional[defaultdict] = None,
      add_series_id: bool = False,
  ) -> None:
      if categorical_encoders is None and numerical_encoders is None:
          self.categorical_encoders = defaultdict(LabelEncoder)
          self.numerical_scalers = defaultdict(StandardScaler)
          self.instances = self._check_consistency(instances)
      else:
          self.categorical_encoders = categorical_encoders
          self.numerical_scalers = numerical_encoders
          self.instances = instances
  
      if scopes is None:
          self.scopes = [
              (ts_id, slice(len(ts)))
              for ts_id, ts in enumerate(self.instances)
          ]
      else:
          self.scopes = scopes
      self.add_series_id = add_series_id
  
imports: from __future__ import annotations
  from typing import List, Tuple, Dict, Union, Sequence, Optional, Callable, overload
  from operator import eq
  from collections import defaultdict
  import warnings
  from sklearn.preprocessing import LabelEncoder, StandardScaler
  from numpy import ndarray
  from tqdm import tqdm
  import numpy
  import pandas
  import torch
label_desc: Use image node_id 1 to create a new TimeSeriesCorpus object from inherited base classes: Sequence with example: obj = TimeSeriesCorpus(instances, scopes, categorical_encoders, numerical_encoders, add_series_id)