code: def lfiltic(b, a, y, x=None):
      """
      Construct initial conditions for lfilter given input and output vectors.
  
      Given a linear filter (b, a) and initial conditions on the output `y`
      and the input `x`, return the initial conditions on the state vector zi
      which is used by `lfilter` to generate the output given the input.
  
      Parameters
      ----------
      b : array_like
          Linear filter term.
      a : array_like
          Linear filter term.
      y : array_like
          Initial conditions.
  
          If ``N = len(a) - 1``, then ``y = {y[-1], y[-2], ..., y[-N]}``.
  
          If `y` is too short, it is padded with zeros.
      x : array_like, optional
          Initial conditions.
  
          If ``M = len(b) - 1``, then ``x = {x[-1], x[-2], ..., x[-M]}``.
  
          If `x` is not given, its initial conditions are assumed zero.
  
          If `x` is too short, it is padded with zeros.
  
      Returns
      -------
      zi : ndarray
          The state vector ``zi = {z_0[-1], z_1[-1], ..., z_K-1[-1]}``,
          where ``K = max(M, N)``.
  
      See Also
      --------
      lfilter, lfilter_zi
  
      """
      N = np.size(a) - 1
      M = np.size(b) - 1
      K = max(M, N)
      y = asarray(y)
      if y.dtype.kind in "bui":
          # ensure calculations are floating point
          y = y.astype(np.float64)
      zi = zeros(K, y.dtype)
      if x is None:
          x = zeros(M, y.dtype)
      else:
          x = asarray(x)
          L = np.size(x)
          if L < M:
              x = r_[x, zeros(M - L)]
      L = np.size(y)
      if L < N:
          y = r_[y, zeros(N - L)]
  
      for m in range(M):
          zi[m] = np.sum(b[m + 1 :] * x[: M - m], axis=0)
  
      for m in range(N):
          zi[m] -= np.sum(a[m + 1 :] * y[: N - m], axis=0)
  
      return zi
  
imports: from __future__ import division, print_function, absolute_import
  import operator
  import threading
  import sys
  import timeit
  from scipy.spatial import cKDTree
  from .None import sigtools, dlti
  from ._upfirdn import upfirdn, _output_len
  from scipy._lib.six import callable
  from scipy._lib._version import NumpyVersion
  from scipy import fftpack, linalg
  from scipy.fftpack.helper import _init_nd_shape_and_axes_sorted
  from numpy import allclose, angle, arange, argsort, array, asarray, atleast_1d, atleast_2d, cast, dot, exp, expand_dims, iscomplexobj, mean, ndarray, newaxis, ones, pi, poly, polyadd, polyder, polydiv, polymul, polysub, polyval, product, r_, ravel, real_if_close, reshape, roots, sort, take, transpose, unique, where, zeros, zeros_like
  import numpy
  import math
  from scipy.special import factorial
  from .windows import get_window
  from ._arraytools import axis_slice, axis_reverse, odd_ext, even_ext, const_ext
  from .filter_design import cheby1, _validate_sos
  from .fir_filter_design import firwin
label_desc: Use image node_id 22 for calling a global function with example usage: lfiltic(b, a, y, x) and returns: zi