code: def test_sliding_generator_flow_invalid():
      g = _graph((2, 10, 4))
      gen = SlidingFeaturesNodeGenerator(g, window_size=2)
  
      with pytest.raises(
          ValueError, match="target_distance: expected .* found 0"
      ):
          gen.flow(slice(None), target_distance=0)
  
      with pytest.raises(
          TypeError, match="target_distance: expected .* found str"
      ):
          gen.flow(slice(None), target_distance="a")
  
      with pytest.raises(
          TypeError,
          match="sequence_iloc_slice: expected .* found NoneType",
      ):
          gen.flow(None)
  
      with pytest.raises(
          TypeError,
          match="sequence_iloc_slice: expected .* step = 1, found step = 2",
      ):
          gen.flow(slice(0, 4, 2))
  
      with pytest.raises(
          ValueError,
          match=r"expected at least one .* window of size 2 \(window_size=2\) which is larger than the 1 selected feature sample\(s\) \(sequence_iloc_slice selected from 9 to 10 in the sequence axis of length 10\)",
      ):
          gen.flow(slice(9, 11))
  
      with pytest.raises(
          ValueError,
          match="expected at least one .* window of size 11 \(window_size=2 \+ target_distance=9\) which is larger than the 10 selected feature sample\(s\) \(sequence_iloc_slice selected from 0 to 10 in the sequence axis of length 10\)",
      ):
          gen.flow(slice(None), target_distance=9)
  
file_path: stellargraph/tests/mapper/test_sliding.py
imports: import numpy
  import pytest
  from stellargraph import StellarGraph
  from stellargraph.mapper import SlidingFeaturesNodeGenerator, SlidingFeaturesNodeSequence
  from ..test_utils.graphs import example_graph, example_hin_1
label_desc: Use image node_id 3 for calling a global function with example usage: test_sliding_generator_flow_invalid() without return types