code: def convolve(signal, kernel):
      """Convolve the iterable *signal* with the iterable *kernel*.
  
          >>> signal = (1, 2, 3, 4, 5)
          >>> kernel = [3, 2, 1]
          >>> list(convolve(signal, kernel))
          [3, 8, 14, 20, 26, 14, 5]
  
      Note: the input arguments are not interchangeable, as the *kernel*
      is immediately consumed and stored.
  
      """
      # This implementation intentionally doesn't match the one in the itertools
      # documentation.
      kernel = tuple(kernel)[::-1]
      n = len(kernel)
      window = deque([0], maxlen=n) * n
      for x in chain(signal, repeat(0, n - 1)):
          window.append(x)
          yield _sumprod(kernel, window)
  
imports: import math
  import operator
  from collections import deque
  from collections.abc import Sized
  from functools import partial, reduce
  from itertools import chain, combinations, compress, count, cycle, groupby, islice, product, repeat, starmap, tee, zip_longest
  from random import randrange, sample, choice
label_desc: Use image node_id 30 for calling a global function with example usage: convolve(signal, kernel) without return types