docstr: Calculate the cycle length of the time series in this TSDataset.
  
  Args:
      top_k (int): The freq with top top_k power after fft will be
          used to check the autocorrelation. Higher top_k might be time-consuming.
          The value is default to 3.
      aggregate (str): Select the mode of calculation time period,
          We only support 'min', 'max', 'mode', 'median', 'mean'.
  
  Returns:
      Describe the value of the time period distribution.
code: def get_cycle_length(self, aggregate="mode", top_k=3):
      """
      Calculate the cycle length of the time series in this TSDataset.
  
      Args:
          top_k (int): The freq with top top_k power after fft will be
              used to check the autocorrelation. Higher top_k might be time-consuming.
              The value is default to 3.
          aggregate (str): Select the mode of calculation time period,
              We only support 'min', 'max', 'mode', 'median', 'mean'.
  
      Returns:
          Describe the value of the time period distribution.
      """
      from bigdl.nano.utils.common import invalidInputError
  
      invalidInputError(
          isinstance(top_k, int),
          f"top_k type must be int, but found {type(top_k)}.",
      )
      invalidInputError(
          isinstance(aggregate, str),
          f"aggregate type must be str, but found {type(aggregate)}.",
      )
      invalidInputError(
          aggregate.lower().strip()
          in ["min", "max", "mode", "median", "mean"],
          f"We Only support 'min' 'max' 'mode' 'median' 'mean',"
          f" but found {aggregate}.",
      )
  
      if len(self.target_col) == 1:
          res = []
          groups = self.df.groupby(self.id_col)
          for _, group in groups:
              res.append(
                  cycle_length_est(
                      group[self.target_col[0]].values, top_k
                  )
              )
          res = pd.Series(res)
      else:
          res = []
          groups = self.df.groupby(self.id_col)
          for _, group in groups:
              res.append(
                  pd.DataFrame(
                      {
                          "cycle_length": [
                              cycle_length_est(group[col].values, top_k)
                              for col in self.target_col
                          ]
                      }
                  )
              )
          res = pd.concat(res, axis=0)
          res = res.cycle_length
  
      if aggregate.lower().strip() == "mode":
          self.best_cycle_length = int(res.value_counts().index[0])
      elif aggregate.lower().strip() == "mean":
          self.best_cycle_length = int(res.mean())
      elif aggregate.lower().strip() == "median":
          self.best_cycle_length = int(res.median())
      elif aggregate.lower().strip() == "min":
          self.best_cycle_length = int(res.min())
      elif aggregate.lower().strip() == "max":
          self.best_cycle_length = int(res.max())
  
      return self.best_cycle_length
  
imports: import pandas
  import numpy
  import functools
  import logging
  from bigdl.chronos.data.utils.feature import generate_dt_features, generate_global_features
  from bigdl.chronos.data.utils.impute import impute_timeseries_dataframe
  from bigdl.chronos.data.utils.deduplicate import deduplicate_timeseries_dataframe
  from bigdl.chronos.data.utils.roll import roll_timeseries_dataframe
  from bigdl.chronos.data.utils.time_feature import time_features, gen_time_enc_arr
  from bigdl.chronos.data.utils.scale import unscale_timeseries_numpy, scale_timeseries_numpy
  from bigdl.chronos.data.utils.resample import resample_timeseries_dataframe
  from bigdl.chronos.data.utils.split import split_timeseries_dataframe
  from bigdl.chronos.data.utils.cycle_detection import cycle_length_est
  from bigdl.chronos.data.utils.quality_inspection import quality_check_timeseries_dataframe, _abnormal_value_repair
  from bigdl.chronos.data.utils.utils import _to_list, _check_type, _check_col_within, _check_col_no_na, _check_is_aligned, _check_dt_is_sorted
label_desc: Use image node_id 21 for calling the TSDataset obj's underlying member method code with example usage: obj.get_cycle_length(aggregate, top_k) and returns: self