docstr: Adjust `ts` its timezone to the `reference_tz`.
docstr_tok: ["Adjust","`","ts","`","its","timezone","to","the","`","reference_tz","`","."]
code: def to_same_tz(
      ts: Union[pd.Timestamp, None],
      reference_tz: Union[pytz.BaseTzInfo, None],
  ) -> Union[pd.Timestamp, None]:
      """Adjust `ts` its timezone to the `reference_tz`."""
      if ts is None:
          return None
      elif reference_tz is not None:
          if ts.tz is not None:
              assert ts.tz.__str__() == reference_tz.__str__()
              return ts
          else:  # localize -> time remains the same
              return ts.tz_localize(reference_tz)
      elif reference_tz is None and ts.tz is not None:
          return ts.tz_localize(None)
      return ts
  
file_path: plotly-resampler/plotly_resampler/aggregation/plotly_aggregator_parser.py
imports: from __future__ import annotations
  import bisect
  from typing import Tuple, Union
  import numpy
  import pandas
  import pytz
  from .aggregation_interface import DataAggregator, DataPointSelector
  from .gap_handler_interface import AbstractGapHandler
  from .gap_handlers import NoGapHandler
label_desc: Use image node_id 2 for calling the PlotlyAggregatorParser obj's underlying member method code with example usage: obj.to_same_tz(ts, reference_tz) and returns: ts, None, ts, ts, ts