class_docstr: Defines a policy to temporally resample a time series at a specified  granularity. Note that while this transform
  does support inversion, the recovered time series may differ from the input due to information loss when resampling.
class_docstr_tok: ["Defines","a","policy","to","temporally","resample","a","time","series","at","a","specified","granularity",".","Note","that","while","this","transform","does","support","inversion",",","the","recovered","time","series","may","differ","from","the","input","due","to","information","loss","when","resampling","."]
docstr: Defines a policy to temporally resample a time series.
  
  :param granularity: The granularity at which we want to resample.
  :param origin: The time stamp defining the offset to start at.
  :param trainable_granularity: Whether  we will automatically infer the granularity of the time series.
      If ``None`` (default), it will be trainable only if no granularity is explicitly given.
  :param remove_non_overlapping: If ``True``, we will only keep the portions
      of the univariates that overlap with each other. For example, if we
      have 3 univariates which span timestamps [0, 3600], [60, 3660], and
      [30, 3540], we will only keep timestamps in the range [60, 3540]. If
      ``False``, we will keep all timestamps produced by the resampling.
  :param aggregation_policy: The policy we will use to aggregate multiple values in a window (downsampling).
  :param missing_value_policy: The policy we will use to impute missing values (upsampling).
docstr_tok: ["Defines","a","policy","to","temporally","resample","a","time","series",".",":","param","granularity",":","The","granularity","at","which","we","want","to","resample",".",":","param","origin",":","The","time","stamp","defining","the","offset","to","start","at",".",":","param","trainable_granularity",":","Whether","we","will","automatically","infer","the","granularity","of","the","time","series",".","If","``","None","``","(","default",")",",","it","will","be","trainable","only","if","no","granularity","is","explicitly","given",".",":","param","remove_non_overlapping",":","If","``","True","``",",","we","will","only","keep","the","portions","of","the","univariates","that","overlap","with","each","other",".","For","example",",","if","we","have","3","univariates","which","span","timestamps","[","0",",","3600","]",",","[","60",",","3660","]",",","and","[","30",",","3540","]",",","we","will","only","keep","timestamps","in","the","range","[","60",",","3540","]",".","If","``","False","``",",","we","will","keep","all","timestamps","produced","by","the","resampling",".",":","param","aggregation_policy",":","The","policy","we","will","use","to","aggregate","multiple","values","in","a","window","(","downsampling",")",".",":","param","missing_value_policy",":","The","policy","we","will","use","to","impute","missing","values","(","upsampling",")","."]
code: def __init__(
      self,
      granularity: Union[str, int, float] = None,
      origin: int = None,
      trainable_granularity: bool = None,
      remove_non_overlapping=True,
      aggregation_policy: Union[str, AggregationPolicy] = "Mean",
      missing_value_policy: Union[
          str, MissingValuePolicy
      ] = "Interpolate",
  ):
      """
      Defines a policy to temporally resample a time series.
  
      :param granularity: The granularity at which we want to resample.
      :param origin: The time stamp defining the offset to start at.
      :param trainable_granularity: Whether  we will automatically infer the granularity of the time series.
          If ``None`` (default), it will be trainable only if no granularity is explicitly given.
      :param remove_non_overlapping: If ``True``, we will only keep the portions
          of the univariates that overlap with each other. For example, if we
          have 3 univariates which span timestamps [0, 3600], [60, 3660], and
          [30, 3540], we will only keep timestamps in the range [60, 3540]. If
          ``False``, we will keep all timestamps produced by the resampling.
      :param aggregation_policy: The policy we will use to aggregate multiple values in a window (downsampling).
      :param missing_value_policy: The policy we will use to impute missing values (upsampling).
      """
      super().__init__()
      self.granularity = granularity
      self.origin = origin
      self.trainable_granularity = (
          (granularity is None)
          if trainable_granularity is None
          else trainable_granularity
      )
      self.remove_non_overlapping = remove_non_overlapping
      self.aggregation_policy = aggregation_policy
      self.missing_value_policy = missing_value_policy
  
imports: from collections import OrderedDict
  import logging
  from typing import Union
  import numpy
  from merlion.transform.base import TransformBase, InvertibleTransformBase
  from merlion.utils import UnivariateTimeSeries, TimeSeries
  from merlion.utils.resample import infer_granularity, granularity_str_to_seconds, AlignPolicy, AggregationPolicy, MissingValuePolicy
label_desc: Use image node_id 1 to create a new TemporalResample object from inherited base classes: TransformBase with example: obj = TemporalResample(granularity, origin, trainable_granularity, remove_non_overlapping, aggregation_policy, missing_value_policy)