<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def safe_chmod(path, mode):
 """Set the permissions mode on path, but only if it differs from the current mode. """

    if stat.S_IMODE(os.stat(path).st_mode) != mode:
        os.chmod(path, mode)