from pathlib import Path


def file_or_dir_exists(target):
    """
    Check if the file or directory exists.

    When the target is a file, 'IS_FILE' is returned.

    When the target is a directory, 'IS_DIR' is returned.

    When the function cannot find the target, it returns 'NOT_FOUND'.

    """
    try:
        file = Path(target)
    except:
        return 'TARGET_INVAILD'
    if file.is_file():
        return 'IS_FILE'
    elif file.is_dir():
        return 'IS_DIR'
    else:
        return False