@workdir_loaded<EOL><INDENT>def destroy(self, prefix_names=None):<DEDENT>
if prefix_names is None:<EOL><INDENT>self.destroy(prefix_names=self.prefixes.keys())<EOL>return<EOL><DEDENT>for prefix_name in prefix_names:<EOL><INDENT>if prefix_name == '<STR_LIT>' and self.current in prefix_names:<EOL><INDENT>continue<EOL><DEDENT>elif prefix_name == '<STR_LIT>':<EOL><INDENT>prefix_name = self.current<EOL><DEDENT>self.get_prefix(prefix_name).destroy()<EOL>self.prefixes.pop(prefix_name)<EOL>if self.prefixes:<EOL><INDENT>self._update_current()<EOL><DEDENT><DEDENT>if not self.prefixes:<EOL><INDENT>shutil.rmtree(self.path)<EOL><DEDENT>
Destroy all the given prefixes and remove any left files if no more
prefixes are left

Args:
    prefix_names(list of str): list of prefix names to destroy, if None
    passed (default) will destroy all of them