code: def check_m(m, seasonal):
      """Check the value of M (seasonal periodicity)"""
      if (m < 1 and seasonal) or m < 0:
          raise ValueError("m must be a positive integer (> 0)")
  
      if not seasonal:
          # default m is 1, so if it's the default, don't warn
          if m > 1:
              warnings.warn(
                  "m (%i) set for non-seasonal fit. Setting to 0" % m
              )
          m = 0
  
      return m
  
file_path: pmdarima/pmdarima/arima/_validation.py
imports: import numpy
  import warnings
  from sklearn import metrics
  from pmdarima.warnings import ModelFitWarning
label_desc: Use image node_id 4 for calling a global function with example usage: check_m(m, seasonal) and returns: m