<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def remove(self, child):
 """ Remove the given child from both child list and child indexes :type child: :class:`Element <hl7apy.core.Element>` :param child: an instance of :class:`Element <hl7apy.core.Element>` subclass """

        try:
            if self.element == child.traversal_parent:
                self._remove_from_traversal_index(child)
            else:
                self._remove_from_index(child)
                self.list.remove(child)
        except:
            raise