code: def _check_lags(lags):
      msg = " ".join(
          [
              "`lags` should be provided as a positive integer scaler, or",
              "a list, tuple or np.ndarray of positive integers,"
              f"but found {type(lags)}.",
          ]
      )
      non_positive_msg = "`lags` should be positive integers."
      if isinstance(lags, int):
          if lags <= 0:
              raise ValueError(non_positive_msg)
          lags = check_array([lags], ensure_2d=False)
      elif isinstance(lags, (list, tuple, np.ndarray)):
          if not all([is_int(lag) for lag in lags]):
              raise TypeError(msg)
          lags = check_array(lags, ensure_2d=False)
          if (lags <= 0).any():
              raise ValueError(non_positive_msg)
      else:
          raise TypeError(msg)
  
      return lags
  
imports: from typing import Union
  import numpy
  import pandas
  from sklearn.utils import check_array
  from sktime.datatypes._utilities import get_cutoff, update_data
  from sktime.transformations.base import BaseTransformer
  from sktime.utils.validation import is_int
label_desc: Use image node_id 1 for calling a global function with example usage: _check_lags(lags) and returns: lags