<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def measure(self, ndim=None):
 """Return the Lebesgue measure of this interval product. Parameters ndim : int, optional Dimension of the measure to apply. ``None`` is interpreted as `true_ndim`, which always results in a finite and positive result (unless the set is a single point). Examples -------- 3.75 0.0 True inf True """

        if self.true_ndim == 0:
            return 0.0

        if ndim is None:
            return self.measure(ndim=self.true_ndim)
        elif ndim < self.true_ndim:
            return np.inf
        elif ndim > self.true_ndim:
            return 0.0
        else:
            return np.prod(self.extent[self.nondegen_byaxis])