def METHOD_NAME(capability: str, sysfs_name: str):
    """
    Check the device has either the given pylib capability for the
    given sysfs name, and vice versa.
    """
    try:
        expected_path = glob.glob(f"{daemon_test_dir}/*:{vid}:{pid}*/{sysfs_name}", recursive=True)[0]
    except IndexError:
        expected_path = ""
    if d.has(capability) and not glob.glob(expected_path, recursive=True):
        _test_failed(d.name, str(hex(d._pid)) + " Has capability '{}' but no sysfs file: '{}'".format(capability, sysfs_name))
    if not d.has(capability) and glob.glob(expected_path, recursive=True):
        _test_failed(d.name, str(hex(d._pid)) + " Has sysfs '{}' but no capability set: '{}'".format(sysfs_name, capability))