def clear(self):
not_removed = []<EOL>for fn in os.listdir(self.base):<EOL><INDENT>fn = os.path.join(self.base, fn)<EOL>try:<EOL><INDENT>if os.path.islink(fn) or os.path.isfile(fn):<EOL><INDENT>os.remove(fn)<EOL><DEDENT>elif os.path.isdir(fn):<EOL><INDENT>shutil.rmtree(fn)<EOL><DEDENT><DEDENT>except Exception:<EOL><INDENT>not_removed.append(fn)<EOL><DEDENT><DEDENT>return not_removed<EOL>
Clear the cache.