def METHOD_NAME(items, config):
    matchexpr = config.option.markexpr
    if not matchexpr:
        return
    remaining = []
    deselected = []
    for item in items:
        if matchmark(item, matchexpr):
            remaining.append(item)
        else:
            deselected.append(item)
    if deselected:
        config.hook.pytest_deselected(items=deselected)
        items[:] = remaining