code: def get_strided_spans(
      docs: Iterable[Doc], window: int, stride: int
  ) -> List[List[Span]]:
      spans: List[List[Span]] = []
      for doc in docs:
          start = 0
          spans.append([])
          for i in range(len(doc) // stride):
              spans[-1].append(doc[start : start + window])
              if (start + window) >= len(doc):
                  break
              start += stride
          else:
              if start < len(doc):
                  spans[-1].append(doc[start:])
      return spans
  
file_path: spacy-transformers/spacy_transformers/span_getters.py
imports: from typing import Callable, Iterable, List
  from functools import partial
  from spacy.tokens import Doc, Span
  from .util import registry
label_desc: Use image node_id 1 for calling a global function with example usage: get_strided_spans(docs, window, stride) and returns: spans