class_docstr: A batch of series from different base datasets, represented by the padded batch, the lengths of the series
  and the splits sizes indicating the corresponding base dataset.
class_docstr_tok: ["A","batch","of","series","from","different","base","datasets",",","represented","by","the","padded","batch",",","the","lengths","of","the","series","and","the","splits","sizes","indicating","the","corresponding","base","dataset","."]
docstr: Initializes a series batch from the provided series.
  
  Args:
      lists: List of lists of time series.
      squeeze: If the last dimension should be squeezed. This should be done for future queries
          which do not contain co-variates and are, thus, univariate
  
  Returns:
      The initialized series batch.
docstr_tok: ["Initializes","a","series","batch","from","the","provided","series",".","Args",":","lists",":","List","of","lists","of","time","series",".","squeeze",":","If","the","last","dimension","should","be","squeezed",".","This","should","be","done","for","future","queries","which","do","not","contain","co-variates","and","are",",","thus",",","univariate","Returns",":","The","initialized","series","batch","."]
code: def from_lists(
      cls, lists: List[List[TimeSeries]], squeeze: bool = False
  ) -> SeriesBatch:
      """
      Initializes a series batch from the provided series.
  
      Args:
          lists: List of lists of time series.
          squeeze: If the last dimension should be squeezed. This should be done for future queries
              which do not contain co-variates and are, thus, univariate
  
      Returns:
          The initialized series batch.
      """
      split_sections = [len(section) for section in lists]
      series = [s for sublist in lists for s in sublist]
      if squeeze:
          values = [torch.squeeze(s.values, -1) for s in series]
      else:
          values = [s.values for s in series]
      return SeriesBatch(
          pad_sequence(values, batch_first=True),
          lengths=torch.as_tensor([len(s) for s in series]),
          split_sections=torch.as_tensor(split_sections),
          scales=torch.stack([s.scale for s in series])
          if series[0].scale is not None
          else None,
      )
  
imports: from __future__ import annotations
  from dataclasses import dataclass
  from typing import List, Optional
  import torch
  from torch.nn.utils.rnn import pad_sequence
  from .sampling import Triplet
  from .dataset import TimeSeries
  from meta.common.torch import tensor_to_np
label_desc: Use image node_id 1 for calling the SeriesBatch obj's underlying member method code with example usage: obj.from_lists(cls, lists, squeeze) and returns: SeriesBatch