code: def _check_decim(info, decim, offset, check_filter=True):
      """Check decimation parameters."""
      if decim < 1 or decim != int(decim):
          raise ValueError("decim must be an integer > 0")
      decim = int(decim)
      new_sfreq = info["sfreq"] / float(decim)
      offset = int(offset)
      if not 0 <= offset < decim:
          raise ValueError(
              f"decim must be at least 0 and less than {decim}, "
              f"got {offset}"
          )
      if check_filter:
          lowpass = info["lowpass"]
          if decim > 1 and lowpass is None:
              warn(
                  "The measurement information indicates data is not low-pass "
                  f"filtered. The decim={decim} parameter will result in a "
                  f"sampling frequency of {new_sfreq} Hz, which can cause "
                  "aliasing artifacts."
              )
          elif decim > 1 and new_sfreq < 3 * lowpass:
              warn(
                  "The measurement information indicates a low-pass frequency "
                  f"of {lowpass} Hz. The decim={decim} parameter will result "
                  f"in a sampling frequency of {new_sfreq} Hz, which can "
                  "cause aliasing artifacts."
              )  # > 50% nyquist lim
      return decim, offset, new_sfreq
  
imports: import json
  import logging
  from collections import OrderedDict
  from copy import deepcopy
  import numpy
  from ._logging import verbose, warn
  from .check import _check_pandas_installed, _check_preload, _validate_type
  from .numerics import _time_mask, object_hash, object_size
label_desc: Use image node_id 1 for calling a global function with example usage: _check_decim(info, decim, offset, check_filter) and returns: decim,  offset,  new_sfreq