code: def generate_cycles(self):
      self.mTimeInfo.addVars(self.mCycleFrame)
      self.mCycleFrame[self.mTrend_residue_name] = self.mTrendFrame[
          self.mTrend_residue_name
      ]
      lCycleFrameEstim = self.mSplit.getEstimPart(self.mCycleFrame)
      self.mDefaultValue = lCycleFrameEstim[
          self.mTrend_residue_name
      ].mean()
      del lCycleFrameEstim
      self.mCyclePerfDict = {}
      lMaxRobustCycle = self.mTrendFrame.shape[0] // 12
      # print("MAX_ROBUST_CYCLE_LENGTH", self.mTrendFrame.shape[0], lMaxRobustCycle);
      lCycleLengths = self.mOptions.mCycleLengths or range(
          2, lMaxRobustCycle + 1
      )
      lCycleFrame = pd.DataFrame()
      lCycleFrame[self.mTrend_residue_name] = self.mTrendFrame[
          self.mTrend_residue_name
      ]
      for i in lCycleLengths:
          if (i > 1) and (i <= lMaxRobustCycle):
              name_i = self.mTrend_residue_name + "_Cycle"
              lCycleFrame[name_i] = (
                  self.mCycleFrame[self.mTimeInfo.mRowNumberColumn] % i
              )
              lCycleFrameEstim = self.mSplit.getEstimPart(lCycleFrame)
              lGroupBy = lCycleFrameEstim.groupby(
                  by=[name_i], sort=False
              )[self.mTrend_residue_name].mean()
              lEncodedValueDict = lGroupBy.to_dict()
              lCycleFrame[name_i + "_enc"] = lCycleFrame[name_i].apply(
                  lambda x: lEncodedValueDict.get(x, self.mDefaultValue)
              )
  
              self.mBestCycleValueDict[i] = lEncodedValueDict
  
              lPerf = tsperf.cPerf()
              # validate the cycles on the validation part
              lValidFrame = self.mSplit.getValidPart(lCycleFrame)
              lCritValue = lPerf.computeCriterion(
                  lValidFrame[self.mTrend_residue_name],
                  lValidFrame[name_i + "_enc"],
                  self.mCriterion,
                  "Validation",
              )
              self.mCyclePerfDict[i] = lCritValue
              if self.mOptions.mDebugCycles:
                  logger = tsutil.get_pyaf_logger()
                  logger.debug(
                      "CYCLE_INTERNAL_CRITERION "
                      + name_i
                      + " "
                      + str(i)
                      + " "
                      + self.mCriterion
                      + " "
                      + str(lCritValue)
                  )
      pass
  
imports: import pandas
  import numpy
  from .None import Time
  from .None import Perf
  from .None import Plots
  from .None import Utils
  import time
label_desc: Use image node_id 5 for calling the cBestCycleForTrend obj's underlying member method code with example usage: obj.generate_cycles() without return types