def METHOD_NAME(
    lgpo,
    name,
    setting,
    hive,
    key,
    vname,
    exp_vdata,
    exp_vtype,
    exp_removed,
):
    """
    Test registry based settings. Validates that the value is set correctly in
    the registry.
    Args:
        name (str): The name of the policy to configure
        setting (str): The setting of the policy
        hive (str): The registry hive the key is in
        key (str): The registry key the value name is in
        vname (str): The registry value name
        exp_vdata (str, int): The expected data that the value will contain
        exp_vtype (str): The registry value type (i.e. REG_SZ, REG_DWORD, etc)
        exp_removed (bool): Define if the registry value will be removed. Some
            policies delete the registry value when set to 'Not Defined'
    """
    # Set the registry based policy
    result = lgpo.set_computer_policy(name=name, setting=setting)
    assert result is True
    # Read the value from the registry
    value = salt.utils.win_reg.read_value(
        hive=hive,
        key=key,
        vname=vname,
    )
    # Some policies may remove the registry key when disabled or set to Not
    # Configured
    if exp_removed:
        assert value["success"] is False
    else:
        assert value["success"] is True
        assert value["vdata"] == exp_vdata
        if exp_vtype:
            assert value["vtype"] == exp_vtype