<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def rm_rf(path):
 """ Act as 'rm -rf' in the shell """

    if os.path.isfile(path):
        os.unlink(path)
    elif os.path.isdir(path):
        for root, dirs, files in os.walk(path, topdown=False):
            for filename in files:
                filepath = os.path.join(root, filename)
                logger.info("Deleting file %s" % filepath)
                os.unlink(filepath)
            for dirname in dirs:
                dirpath = os.path.join(root, dirname)
                if os.path.islink(dirpath):
                    logger.info("Deleting link %s" % dirpath)
                    os.unlink(dirpath)
                else:
                    logger.info("Deleting dir %s" % dirpath)
                    os.rmdir(dirpath)
        logger.info("Deleting dir %s", path)
        os.rmdir(path)