def integrate(self, a, b, extrapolate=None):
if extrapolate is None:<EOL><INDENT>extrapolate = self.extrapolate<EOL><DEDENT>sign = <NUM_LIT:1><EOL>if b < a:<EOL><INDENT>a, b = b, a<EOL>sign = -<NUM_LIT:1><EOL><DEDENT>range_int = np.empty((prod(self.c.shape[<NUM_LIT:2>:]),), dtype=self.c.dtype)<EOL>self._ensure_c_contiguous()<EOL>_ppoly.integrate(self.c.reshape(self.c.shape[<NUM_LIT:0>], self.c.shape[<NUM_LIT:1>], -<NUM_LIT:1>),<EOL>self.x, a, b, bool(extrapolate),<EOL>out=range_int)<EOL>range_int *= sign<EOL>return range_int.reshape(self.c.shape[<NUM_LIT:2>:])<EOL>
Compute a definite integral over a piecewise polynomial.

Parameters
----------
a : float
    Lower integration bound
b : float
    Upper integration bound
extrapolate : bool, optional
    Whether to extrapolate to ouf-of-bounds points based on first
    and last intervals, or to return NaNs.

Returns
-------
ig : array_like
    Definite integral of the piecewise polynomial over [a, b]