<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def element(self, inp=None):
 """Return an element of this interval product. Parameters inp : float or `array-like`, optional Point to be cast to an element. Returns ------- element : `numpy.ndarray` or float Array (`ndim` > 1) or float version of ``inp`` if provided, otherwise ``self.mid_pt``. Examples -------- 0.5 """

        if inp is None:
            return self.mid_pt
        elif inp in self:
            if self.ndim == 1:
                return float(inp)
            else:
                return np.asarray(inp)
        else:
            raise TypeError('`inp` {!r} is not a valid element of {!r}'
                            ''.format(inp, self))