This convolution function is a part of your numpy. So you have to import your numpy module. And also create two arrays as shown below.
import numpy as np
arr = np.array([0,0,0,1,1,1,0,0,0])
To perform convolution you have to pass these two array as follows.