code: def conv1d_ncw_python(a_np, w_np, stride, padding, dilation):
      """1D convolution operator in NCW layout
  
      Parameters
      ----------
      a_np : numpy.ndarray
          3-D with shape [batch, in_channel, in_width]
  
      w_np : numpy.ndarray
          3-D with shape [num_filter, in_channel, filter_width]
  
      stride : int
          Stride size
  
      padding : int, tuple, or str
          Single int for padding size or tuple of (left, right) padding
          or a string in ['VALID', 'SAME']
  
      dilation : int
          Dilation rate of the kernel
  
      groups : int
          Number of groups in the convolution
  
      Returns
      -------
      b_np : numpy.ndarray
          3-D with shape [batch, out_channel, out_width]
      """
      batch, in_c, in_w = a_np.shape
      out_c, _, filter_w = w_np.shape
      if isinstance(stride, (tuple, list)):
          stride = stride[0]
      if isinstance(dilation, (tuple, list)):
          dilation = dilation[0]
  
      dilated_filter_w = (filter_w - 1) * dilation + 1
      pad_left, pad_right = get_pad_tuple1d(
          padding, (dilated_filter_w,)
      )
      out_w = (
          (in_w - dilated_filter_w + pad_left + pad_right) // stride
      ) + 1
  
      padded_a_np = np.zeros((batch, in_c, in_w + pad_left + pad_right))
      padded_a_np[:, :, pad_left : (in_w + pad_left)] = a_np
  
      b_np = np.zeros((batch, out_c, out_w))
      for n in range(batch):
          for f in range(out_c):
              for c in range(in_c):
                  out = np.convolve(
                      padded_a_np[n, c],
                      np.flip(dilate_np(w_np[f, c], dilation)),
                      mode="valid",
                  )
                  b_np[n, f] += out[::stride]
      return b_np
  
imports: import numpy
  from tvm.topi.nn.utils import get_pad_tuple1d
label_desc: Use image node_id 3 for calling a global function with example usage: conv1d_ncw_python(a_np, w_np, stride, padding, dilation) and returns: b_np