<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def module(self):
 """Returns the module that this code element belongs to."""

        if self._module is None:
            root = self
            while self._module is None and root is not None:
                if isinstance(root, Module):
                    self._module = root
                else:
                    root = root.parent

        return self._module