code: def __init__(
      self,
      features,
      window_size,
      batch_size,
      sequence_iloc_slice,
      target_distance,
  ):
      if target_distance is not None:
          require_integer_in_range(
              target_distance, "target_distance", min_val=1
          )
  
      if not isinstance(sequence_iloc_slice, slice):
          raise TypeError(
              f"sequence_iloc_slice: expected a slice(...) object, found {type(sequence_iloc_slice).__name__}"
          )
  
      if sequence_iloc_slice.step not in (None, 1):
          raise TypeError(
              f"sequence_iloc_slice: expected a slice object with a step = 1, found step = {sequence_iloc_slice.step}"
          )
  
      self._features = features[:, sequence_iloc_slice, ...]
      shape = self._features.shape
      self._num_nodes = shape[0]
      self._num_sequence_samples = shape[1]
      self._num_sequence_variates = shape[2:]
  
      self._window_size = window_size
      self._target_distance = target_distance
      self._batch_size = batch_size
  
      query_length = window_size + (
          0 if target_distance is None else target_distance
      )
      self._num_windows = self._num_sequence_samples - query_length + 1
  
      # if there's not enough data to fill one window, there's a problem!
      if self._num_windows <= 0:
          if target_distance is None:
              target_str = ""
          else:
              target_str = f" + target_distance={target_distance}"
  
          total_sequence_samples = features.shape[1]
          start, stop, step = sequence_iloc_slice.indices(
              total_sequence_samples
          )
          # non-trivial steps aren't supported at the moment, so this doesn't need to be included
          # in the message
          assert step == 1
  
          raise ValueError(
              f"expected at least one sliding window of features, found a total window of size {query_length} (window_size={window_size}{target_str}) which is larger than the {self._num_sequence_samples} selected feature sample(s) (sequence_iloc_slice selected from {start} to {stop} in the sequence axis of length {total_sequence_samples})"
          )
  
file_path: stellargraph/stellargraph/mapper/sliding.py
imports: import numpy
  from .None import Generator
  from tensorflow.keras.utils import Sequence
  from ..core.validation import require_integer_in_range
label_desc: Use image node_id 1 to create a new SlidingFeaturesNodeSequence object from inherited base classes: Sequence with example: obj = SlidingFeaturesNodeSequence(features, window_size, batch_size, sequence_iloc_slice, target_distance)