def METHOD_NAME(
    self, convolve: np.ndarray, substring: np.ndarray
) -> np.ndarray:
    convolve = np.copy(convolve)
    if self.max_offset_samples is None:
        return convolve
    offset_to_index = lambda offset: len(convolve) - 1 + offset - len(substring)
    convolve[: offset_to_index(-self.max_offset_samples)] = float("-inf")
    convolve[offset_to_index(self.max_offset_samples) :] = float("-inf")
    return convolve