<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def inner(self, x1, x2):
 """Return the inner product of ``x1`` and ``x2``. Parameters x1, x2 : `LinearSpaceElement` Elements whose inner product to compute. Returns ------- inner : `LinearSpace.field` element Inner product of ``x1`` and ``x2``. """

        if x1 not in self:
            raise LinearSpaceTypeError('`x1` {!r} is not an element of '
                                       '{!r}'.format(x1, self))
        if x2 not in self:
            raise LinearSpaceTypeError('`x2` {!r} is not an element of '
                                       '{!r}'.format(x2, self))
        inner = self._inner(x1, x2)
        if self.field is None:
            return inner
        else:
            return self.field.element(self._inner(x1, x2))