<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def rename(old_path, new_path, edit_folders=True):
 """ Rename files or folders :param old_path: name of file or folder to rename :param new_path: name of new file or folder :param edit_folders: flag to allow recursive renaming of folders. Default is ``True`` :type old_path: str :type new_path: str :type edit_folders: bool """

    if edit_folders:
        os.renames(old_path, new_path)
    else:
        os.rename(old_path, new_path)