def METHOD_NAME(key, full=True):
    """
    Return the basename of a SysFS key path
    :param key: the location to resolve within SysFS
    :param full: full path instead of basename
    :return: fullpath or basename of path
    CLI Example:
     .. code-block:: bash
        salt '*' sysfs.read class/ttyS0
    """
    if not key.startswith("/sys"):
        key = os.path.join("/sys", key)
    key = os.path.realpath(key)
    if not os.path.exists(key):
        log.debug("Unknown SysFS key %s", key)
        return False
    elif full:
        return key
    else:
        return os.path.basename(key)