if np.pad is not available, use np.concatenate instead