code: def sliding_window(
      channel: channel_types.BaseChannel, window_size: int
  ):
      """Returns artifacts with a sliding window applied.
  
      For example, for a channel with artifacts [A, B, C, D] and window_size = 2,
      [[A, B], [B, C], [C, D]] will be returned.
  
      For Examples artifacts, sequential_rolling_range() should be used instead.
  
      Because sliding_window() returns multiple windows, it must be used
      together with ForEach.
  
      Usage:
  
      ```python
      # In ASYNC pipeline:
      with ForEach(
          sliding_window(statistics_gen.outputs['statistics'], window_size=2)
      ) as statistics_pair:
        distribution_validator = DistributionValidator(
            baseline_statistics=pick(statistics_pair, 0),
            statistics=pick(statistics_pair, 1),
            ...
        )
      ```
  
      Args:
        channel: A channel instance (e.g. `my_component.outputs['x']`).
        window_size: The length of the sliding window, must be > 0.
  
      Returns:
        Artifacts with a sliding window applied.
      """
      return ops.SlidingWindow(channel, window_size=window_size)
  
imports: from typing import Optional, Sequence, Union
  from absl import logging
  from tfx.dsl.input_resolution import resolver_function
  from tfx.dsl.input_resolution.ops import ops
  from tfx.types import artifact
  from tfx.types import channel
label_desc: Use image node_id 17 for calling a global function with example usage: sliding_window(channel, window_size) and returns: ops