code: def infer_seasonality(train, index=0):  ##skip the first one, normally
      interval, power = periodogram(
          train, min_period=4, max_period=None
      )
      try:
          season = int(
              pd.DataFrame([interval, power])
              .T.sort_values(1, ascending=False)
              .iloc[0, index]
          )
      except:
          print("Failed")
      return min(season, 5)
  
imports: import pandas
  import numpy
  import statsmodels.api
  from scipy import signal, integrate
  from pykalman import UnscentedKalmanFilter
  from tsaug import *
  from fbprophet import Prophet
  import pylab
  from seasonal.periodogram import periodogram
label_desc: Use image node_id 1 for calling a global function with example usage: infer_seasonality(train, index) and returns: min