class_docstr: Class for the purpose of preprocessing time series.
  
  The method make_features needs to be custom-made by inherited classes.
class_docstr_tok: ["Class","for","the","purpose","of","preprocessing","time","series",".","The","method","make_features","needs","to","be","custom-made","by","inherited","classes","."]
docstr: Outputs a reasonable choice for number of windows to sample from each
  time series at training time.
docstr_tok: ["Outputs","a","reasonable","choice","for","number","of","windows","to","sample","from","each","time","series","at","training","time","."]
code: def get_num_samples(self, ts_list) -> int:
      """
      Outputs a reasonable choice for number of windows to sample from each
      time series at training time.
      """
      n_time_series = sum(
          len(time_series["target"])
          - self.context_window_size
          - self.forecast_horizon
          >= 0
          for time_series in ts_list
      )
      max_size_ts = max(
          len(time_series["target"]) for time_series in ts_list
      )
      n_windows_per_time_series = self.max_n_datapts // n_time_series
      if n_time_series * 1000 < n_windows_per_time_series:
          n_windows_per_time_series = n_time_series * 1000
      elif n_windows_per_time_series == 0:
          n_windows_per_time_series = 1
      elif n_windows_per_time_series > max_size_ts:
          n_windows_per_time_series = -1
      return n_windows_per_time_series
  
imports: import concurrent.futures
  import logging
  from enum import Enum
  from itertools import chain, starmap
  from typing import Dict, List, Tuple, Union, Optional, Sequence
  import numpy
  from gluonts.core.component import validated
label_desc: Use image node_id 6 for calling the PreprocessGeneric obj's underlying member method code with example usage: obj.get_num_samples(ts_list) and returns: n_windows_per_time_series