<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def renames(from_path, to_path, user=None):
 """ Rename ``from_path`` to ``to_path``, creating parents as needed. """

    to_dir = path.dirname(to_path)
    if to_dir:
        mkdir(to_dir, user=user)
    rename(from_path, to_path, user=user)