code: def _generate_offset_idx(n, start, stop, offset, seed):
      if seed is not None:
          idx = check_random_state(seed).permutation(n)
      else:
          idx = np.arange(n)
      return idx[start - offset : stop - offset] + offset
  
imports: import itertools
  import logging
  import numbers
  import warnings
  import dask
  import dask.array
  import dask.dataframe
  import numpy
  import sklearn.model_selection
  from sklearn.model_selection._split import BaseCrossValidator, _validate_shuffle_split
  from sklearn.utils import check_random_state
  from dask_ml._compat import DASK_2130, DASK_VERSION
  from dask_ml.utils import check_array, check_matching_blocks
  from .._utils import draw_seed
label_desc: Use image node_id 4 for calling a global function with example usage: _generate_offset_idx(n, start, stop, offset, seed) and returns: unknown