def remove_nodes(self, pattern, adict):
mydict = self._filetree if adict is None else adict<EOL>if isinstance(mydict, dict):<EOL><INDENT>for nom in mydict.keys():<EOL><INDENT>if isinstance(mydict[nom], dict):<EOL><INDENT>matchs = filter_list(mydict[nom], pattern)<EOL>for nom in matchs:<EOL><INDENT>mydict = self.remove_nodes(pattern, mydict[nom])<EOL>mydict.pop(nom)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>mydict[nom] = filter_list(mydict[nom], pattern)<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>matchs = set(filter_list(mydict, pattern))<EOL>mydict = set(mydict) - matchs<EOL><DEDENT>return mydict<EOL>
Remove the nodes that match the pattern.