def add_fs_notification(f_path, callback):
    """Adds an FSEvent notification for the specified path"""
    path = os.path.realpath(os.path.expanduser(f_path))
    if not os.path.exists(path):
        raise AttributeError("Cannot add an FSEvent notification: %s does not exist!" % path)

    if not os.path.isdir(path):
        path = os.path.dirname(path)

    try:
        FS_WATCHED_FILES[path].append(callback)
    except __HOLE__:
        FS_WATCHED_FILES[path] = [callback]
dataset/ETHPy150Open nigelkersten/pymacadmin/bin/crankd.py/add_fs_notification