Helper function that sets the Advanced Audit settings in the two .csv files
    on Windows. Those files are located at:
    C:\\Windows\\Security\\Audit\\audit.csv
    C:\\Windows\\System32\\GroupPolicy\\Machine\\Microsoft\\Windows NT\\Audit\\audit.csv

    Args:
        option (str): The name of the option to set
        value (str): The value to set. ['None', '0', '1', '2', '3']

    Returns:
        bool: ``True`` if successful, otherwise ``False``

def _set_audit_file_data(option, value):
    '''
    Helper function that sets the Advanced Audit settings in the two .csv files
    on Windows. Those files are located at:
    C:\\Windows\\Security\\Audit\\audit.csv
    C:\\Windows\\System32\\GroupPolicy\\Machine\\Microsoft\\Windows NT\\Audit\\audit.csv

    Args:
        option (str): The name of the option to set
        value (str): The value to set. ['None', '0', '1', '2', '3']

    Returns:
        bool: ``True`` if successful, otherwise ``False``
    '''
    # Set up some paths here
    system_root = os.environ.get('SystemRoot', 'C:\\Windows')
    f_audit = os.path.join(system_root, 'security', 'audit', 'audit.csv')
    f_audit_gpo = os.path.join(system_root, 'System32', 'GroupPolicy',
                               'Machine', 'Microsoft', 'Windows NT',
                               'Audit', 'audit.csv')
    f_temp = tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.csv',
                                         prefix='audit')

    # Lookup dict for "Inclusion Setting" field
    auditpol_values = {'None': 'No Auditing',
                       '0': 'No Auditing',
                       '1': 'Success',
                       '2': 'Failure',
                       '3': 'Success and Failure'}

    try:
        # Open the existing audit.csv and load the csv `reader`
        with salt.utils.files.fopen(f_audit, mode='r') as csv_file:
            reader = csv.DictReader(csv_file)

            # Open the temporary .csv and load the csv `writer`
            with salt.utils.files.fopen(f_temp.name, mode='w') as tmp_file:
                writer = csv.DictWriter(tmp_file, fieldnames=reader.fieldnames)

                # Write the header values (labels)
                writer.writeheader()

                value_written = False
                # Loop through the current audit.csv and write the changes to
                # the temp csv file for existing settings
                for row in reader:
                    # If the row matches the value we're setting, update it with
                    # the new value
                    if row['Subcategory'] == option:
                        if not value == 'None':
                            # The value is not None, make the change
                            row['Inclusion Setting'] = auditpol_values[value]
                            row['Setting Value'] = value
                            log.debug('LGPO: Setting {0} to {1}'
                                      ''.format(option, value))
                            writer.writerow(row)
                        else:
                            # value is None, remove it by not writing it to the
                            # temp file
                            log.debug('LGPO: Removing {0}'.format(option))
                        value_written = True
                    # If it's not the value we're setting, just write it
                    else:
                        writer.writerow(row)

                # If a value was not written, it is a new setting not found in
                # the existing audit.cvs file. Add the new setting with values
                # from the defaults
                if not value_written:
                    if not value == 'None':
                        # value is not None, write the new value
                        log.debug('LGPO: Setting {0} to {1}'
                                  ''.format(option, value))
                        defaults = _get_audit_defaults(option)
                        writer.writerow({
                            'Machine Name': defaults['Machine Name'],
                            'Policy Target': defaults['Policy Target'],
                            'Subcategory': defaults['Subcategory'],
                            'Subcategory GUID': defaults['Subcategory GUID'],
                            'Inclusion Setting': auditpol_values[value],
                            'Exclusion Setting': defaults['Exclusion Setting'],
                            'Setting Value': value})
                    value_written = True

        if value_written:
            # Copy the temporary csv file over the existing audit.csv in both
            # locations if a value was written
            __salt__['file.copy'](f_temp.name, f_audit, remove_existing=True)
            __salt__['file.makedirs'](f_audit_gpo)
            __salt__['file.copy'](f_temp.name, f_audit_gpo, remove_existing=True)
    finally:
        f_temp.close()
        __salt__['file.remove'](f_temp.name)

    return value_written