code: def shingle(sequence, size):
      """
      Generator that yields shingles (a rolling window) of a given size.
  
      Parameters
      ----------
      sequence : iterable
                 Sequence to be shingled
      size : int
             size of shingle (window)
      """
      iterator = iter(sequence)
      init = (next(iterator) for _ in range(size))
      window = deque(init, maxlen=size)
      if len(window) < size:
          raise IndexError("Sequence smaller than window size")
      yield np.asarray(window)
      for elem in iterator:
          window.append(elem)
          yield np.asarray(window)
  
label_desc: Use image node_id 1 for calling a global function with example usage: shingle(sequence, size) without return types