docstr: The preprocess function iterates over the dataset to gather data that
  is necessary for grouping.
  This includes:
      1) Storing first/last timestamp in the dataset
      2) Aligning time series
      3) Calculating groups
docstr_tok: ["The","preprocess","function","iterates","over","the","dataset","to","gather","data","that","is","necessary","for","grouping",".","This","includes",":","1",")","Storing","first\/last","timestamp","in","the","dataset","2",")","Aligning","time","series","3",")","Calculating","groups"]
code: def _preprocess(self, dataset: Dataset) -> None:
      """
      The preprocess function iterates over the dataset to gather data that
      is necessary for grouping.
      This includes:
          1) Storing first/last timestamp in the dataset
          2) Aligning time series
          3) Calculating groups
      """
      for data in dataset:
          timestamp = data["start"]
          self.first_timestamp = min(self.first_timestamp, timestamp)
  
          self.frequency = (
              timestamp.freq
              if self.frequency is None
              else self.frequency
          )
          self.last_timestamp = max(
              self.last_timestamp,
              timestamp + len(data["target"]) * self.frequency,
          )
  
          # todo
          self.max_target_length = max(
              self.max_target_length, len(data["target"])
          )
      logging.info(
          f"first/last timestamp found: {self.first_timestamp}/{self.last_timestamp}"
      )
  
file_path: gluonts/src/gluonts/nursery/robust-mts-attack/multivariate/datasets/grouper.py
imports: import logging
  import numpy
  import pandas
  from gluonts.dataset.common import ListDataset, DataEntry, Dataset
label_desc: Use image node_id 6 for calling the Grouper obj's underlying member method code with example usage: obj._preprocess(dataset) without return types