def clean(self, elements):
cleanelements = []<EOL>for i in xrange(len(elements)):<EOL><INDENT>if isempty(elements[i]):<EOL><INDENT>return []<EOL><DEDENT>next = elements[i]<EOL>if isinstance(elements[i], (list, tuple)):<EOL><INDENT>next = self.clean(elements[i])<EOL><DEDENT>if next:<EOL><INDENT>cleanelements.append(elements[i])<EOL><DEDENT><DEDENT>return cleanelements<EOL>
Removes empty or incomplete answers.