code: def check_temporal_index(
      burn_in,
      step_size,
      window,
      lag,
      n_samples,
      raise_on_exception=None,
  ):
      """Check that folds can be constructed from passed arguments."""
      names = ["burn_in", "step_size", "window", "lag"]
      for name, i in zip(names, [burn_in, step_size, window, lag]):
          if i is None and name == "window":
              continue
  
          if not isinstance(i, Integral):
              raise ValueError(
                  "argument %s must be an integer. "
                  "type(%s) was passed." % (name, type(i))
              )
  
          if i == 0 and name == "lag":
              continue
  
          if i <= 0:
              raise ValueError(
                  "%s must be a positive integer. Got %r" % (name, i)
              )
  
      if burn_in >= n_samples:
          raise ValueError("burn_in larger than number of samples")
      if step_size >= n_samples:
          raise ValueError("step_size larger than number of samples")
      if lag >= n_samples:
          raise ValueError("lag is larger than number of samples")
      if lag >= burn_in:
          raise ValueError(
              "lag is larger than burn_in (no training fold)"
          )
  
imports: from __future__ import division
  from numbers import Integral
  import warnings
label_desc: Use image node_id 4 for calling a global function with example usage: check_temporal_index(burn_in, step_size, window, lag, n_samples, raise_on_exception) without return types