def preparedir(target_dir, remove_content=True):
if os.path.isdir(target_dir):<EOL><INDENT>if remove_content:<EOL><INDENT>nukedir(target_dir, False)<EOL><DEDENT>return True<EOL><DEDENT>else:<EOL><INDENT>try:<EOL><INDENT>os.makedirs(target_dir)<EOL>return True<EOL><DEDENT>except Exception as e:<EOL><INDENT>print("<STR_LIT>" % (target_dir, e))<EOL>return False<EOL><DEDENT><DEDENT>
Prepare a folder for analysis.

    This method creates the folder if it is not created, and removes the file in
    the folder if the folder already existed.