<commit_before><script id="sg-action-buttons.html" type="text/ng-template">
    <button type="submit" class="btn btn-sm btn-small sg-column-{{simpleGrid.options.columns.length}}"
            ng-if="simpleGrid.options.showEditButton"
            ng-click="editRequested(row)"
            ng-focus="cellFocused(row, null)"
            ng-blur="cellBlurred(row, null)"
            ng-keydown="keydown($event, rowIndex, simpleGrid.options.columns.length)"
            ng-disabled="(row.$deleted || simpleGrid.options.disabled)"
            ng-class="{'btn-info': !row.$editable, 'btn-success': row.$editable}"
            >
        <i class="glyphicon"
           ng-class="{'glyphicon-pencil icon-pencil': !row.$editable, 'glyphicon-ok icon-ok': row.$editable}"></i>
    </button>
    <button type="button"
            class="btn btn-sm btn-small sg-column-{{simpleGrid.options.columns.length+2}}"
            ng-if="simpleGrid.options.showDeleteButton"
            ng-click="toggleDeleted(row)"
            ng-focus="cellFocused(row, null)"
            ng-blur="cellBlurred(row, null)"
            ng-keydown="keydown($event, rowIndex, simpleGrid.options.columns.length+2)"
            ng-disabled="simpleGrid.options.disabled"
            ng-class="{'btn-danger': !row.$deleted, 'btn-warning': row.$deleted}"
            >
        <i class="glyphicon icon-white"
           ng-class="{'glyphicon-remove icon-remove': !row.$deleted, 'glyphicon-repeat icon-repeat': row.$deleted}"></i>
    </button>
</script>

<script id="sg-editable-cell.html" type="text/ng-template">
    <select ng-if="column.inputType === 'select'"
            class="form-control sg-column-{{columnIndex}}"
            ng-model="row[column.field]"
            ng-required="column.required"
            ng-focus="cellFocused(row, column)"
            ng-blur="cellBlurred(row, column)"
            ng-keydown="keydown($event, rowIndex, columnIndex)"
            ng-disabled="((row.$deleted || simpleGrid.options.disabled) || column.disabled)"
            ng-options="option.value as option.title for option in column.$options"/>

    <input ng-if="column.inputType !== 'select'"
           class="form-control sg-column-{{columnIndex}}"
           type="{{ column.inputType || 'text' }}"
           ng-model="row[column.field]"
           ng-required="column.required"
           placeholder="{{column.placeholder}}"
           ng-focus="cellFocused(row, column)"
           ng-blur="cellBlurred(row, column)"
           ng-keydown="keydown($event, rowIndex, columnIndex)"
           ng-readonly="((row.$deleted || simpleGrid.options.disabled) || column.disabled)"
            />
</script>

<script id="sg-row.html" type="text/ng-template">
    <td ng-if="simpleGrid.options.allowMultiSelect" class="sg-multi-select-cell">
        <input class="form-control sg-column--1"
               type="checkbox"
               ng-disabled="row.$deleted"
               ng-focus="cellFocused(row, null)"
               ng-blur="cellBlurred(row, null)"
               ng-model="row.$selected"
               style="cursor:pointer;"
               ng-keydown="keydown($event, rowIndex, -1)"/>
    </td>
    <td ng-if="!gridIsEditable || (simpleGrid.options.perRowEditModeEnabled && !row.$editable)"
        ng-repeat="column in simpleGrid.options.columns"
        ng-init="columnIndex = $index"
        class="sg-data-cell"
        ng-dblclick="startEditingCell($event, rowIndex, columnIndex, row, column)"
        ng-switch="column.inputType">
        <!-- non-editable checkbox -->
        <input ng-switch-when="checkbox"
               type="checkbox"
               ng-checked="row[column.field]"
               disabled="disabled"
               class="form-control"
                />
            <span ng-switch-default="">
                {{getCellText(row, column)}}
            </span>
    </td>

    <td ng-if="gridIsEditable && (!simpleGrid.options.perRowEditModeEnabled || row.$editable)"
        ng-repeat="column in simpleGrid.options.columns"
        ng-init="columnIndex = $index"
        class="sg-data-cell"
        ng-include="'sg-editable-cell.html'">
    </td>

    <td ng-if="simpleGrid.options.showDeleteButton || simpleGrid.options.showEditButton" class="sg-actions-cell"
        ng-include="'sg-action-buttons.html'">
    </td>
</script>

<table class="table table-striped simple-grid">

    <thead>
    <tr>
        <th ng-if="simpleGrid.options.allowMultiSelect" class="sg-multi-select-cell">&nbsp;</th>
        <th ng-repeat="column in simpleGrid.options.columns">{{column.$title}}</th>
        <th ng-if="simpleGrid.options.showDeleteButton" class="sg-actions-cell"></th>
    </tr>
    </thead>

    <tbody>

    <tr ng-if="!data.length">
        <td colspan="0"><em>No items</em></td>
    </tr>
    <tr ng-repeat="row in page"
        ng-init="rowIndex = $index"
        ng-click="setFocusedRow(row)"
        ng-form="{{formName($index)}}"
        id="{{formName($index)}}"
        ng-class="{ deleted: row.$deleted, 
                    added: row.$added, 
                    selected: row.$selected,
                    focused: row.$focused, 
                    editable: row.$editable || !simpleGrid.options.perRowEditModeEnabled,
                    'not-editable': !row.$editable && simpleGrid.options.perRowEditModeEnabled
                  }"
        ng-include="'sg-row.html'">
    </tr>

    <tr class="sg-dummy-row" ng-if="simpleGrid.options.perRowEditModeEnabled">
        <td ng-repeat="column in simpleGrid.options.columns"
            ng-init="columnIndex = $index"
            class="sg-data-cell"
            ng-include="'sg-editable-cell.html'">
        </td>
        <td ng-if="simpleGrid.options.showDeleteButton || simpleGrid.options.showEditButton"
            class="sg-actions-cell"
            ng-include="'sg-action-buttons.html'">
        </td><commit_msg>Set ng-required to false in the dummy row<commit_after><script id="sg-action-buttons.html" type="text/ng-template">
    <button type="submit" class="btn btn-sm btn-small sg-column-{{simpleGrid.options.columns.length}}"
            ng-if="simpleGrid.options.showEditButton"
            ng-click="editRequested(row)"
            ng-focus="cellFocused(row, null)"
            ng-blur="cellBlurred(row, null)"
            ng-keydown="keydown($event, rowIndex, simpleGrid.options.columns.length)"
            ng-disabled="(row.$deleted || simpleGrid.options.disabled)"
            ng-class="{'btn-info': !row.$editable, 'btn-success': row.$editable}"
            >
        <i class="glyphicon"
           ng-class="{'glyphicon-pencil icon-pencil': !row.$editable, 'glyphicon-ok icon-ok': row.$editable}"></i>
    </button>
    <button type="button"
            class="btn btn-sm btn-small sg-column-{{simpleGrid.options.columns.length+2}}"
            ng-if="simpleGrid.options.showDeleteButton"
            ng-click="toggleDeleted(row)"
            ng-focus="cellFocused(row, null)"
            ng-blur="cellBlurred(row, null)"
            ng-keydown="keydown($event, rowIndex, simpleGrid.options.columns.length+2)"
            ng-disabled="simpleGrid.options.disabled"
            ng-class="{'btn-danger': !row.$deleted, 'btn-warning': row.$deleted}"
            >
        <i class="glyphicon icon-white"
           ng-class="{'glyphicon-remove icon-remove': !row.$deleted, 'glyphicon-repeat icon-repeat': row.$deleted}"></i>
    </button>
</script>

<script id="sg-editable-cell.html" type="text/ng-template">
    <select ng-if="column.inputType === 'select'"
            class="form-control sg-column-{{columnIndex}}"
            ng-model="row[column.field]"
            ng-required="column.required && !isDummy"
            ng-focus="cellFocused(row, column)"
            ng-blur="cellBlurred(row, column)"
            ng-keydown="keydown($event, rowIndex, columnIndex)"
            ng-disabled="((row.$deleted || simpleGrid.options.disabled) || column.disabled)"
            ng-options="option.value as option.title for option in column.$options"/>

    <input ng-if="column.inputType !== 'select'"
           class="form-control sg-column-{{columnIndex}}"
           type="{{ column.inputType || 'text' }}"
           ng-model="row[column.field]"
           ng-required="column.required && !isDummy"
           placeholder="{{column.placeholder}}"
           ng-focus="cellFocused(row, column)"
           ng-blur="cellBlurred(row, column)"
           ng-keydown="keydown($event, rowIndex, columnIndex)"
           ng-readonly="((row.$deleted || simpleGrid.options.disabled) || column.disabled)"
            />
</script>

<script id="sg-row.html" type="text/ng-template">
    <td ng-if="simpleGrid.options.allowMultiSelect" class="sg-multi-select-cell">
        <input class="form-control sg-column--1"
               type="checkbox"
               ng-disabled="row.$deleted"
               ng-focus="cellFocused(row, null)"
               ng-blur="cellBlurred(row, null)"
               ng-model="row.$selected"
               style="cursor:pointer;"
               ng-keydown="keydown($event, rowIndex, -1)"/>
    </td>
    <td ng-if="!gridIsEditable || (simpleGrid.options.perRowEditModeEnabled && !row.$editable)"
        ng-repeat="column in simpleGrid.options.columns"
        ng-init="columnIndex = $index"
        class="sg-data-cell"
        ng-dblclick="startEditingCell($event, rowIndex, columnIndex, row, column)"
        ng-switch="column.inputType">
        <!-- non-editable checkbox -->
        <input ng-switch-when="checkbox"
               type="checkbox"
               ng-checked="row[column.field]"
               disabled="disabled"
               class="form-control"
                />
            <span ng-switch-default="">
                {{getCellText(row, column)}}
            </span>
    </td>

    <td ng-if="gridIsEditable && (!simpleGrid.options.perRowEditModeEnabled || row.$editable)"
        ng-repeat="column in simpleGrid.options.columns"
        ng-init="columnIndex = $index"
        class="sg-data-cell"
        ng-include="'sg-editable-cell.html'">
    </td>

    <td ng-if="simpleGrid.options.showDeleteButton || simpleGrid.options.showEditButton" class="sg-actions-cell"
        ng-include="'sg-action-buttons.html'">
    </td>
</script>

<table class="table table-striped simple-grid">

    <thead>
    <tr>
        <th ng-if="simpleGrid.options.allowMultiSelect" class="sg-multi-select-cell">&nbsp;</th>
        <th ng-repeat="column in simpleGrid.options.columns">{{column.$title}}</th>
        <th ng-if="simpleGrid.options.showDeleteButton" class="sg-actions-cell"></th>
    </tr>
    </thead>

    <tbody>

    <tr ng-if="!data.length">
        <td colspan="0"><em>No items</em></td>
    </tr>
    <tr ng-repeat="row in page"
        ng-init="rowIndex = $index"
        ng-click="setFocusedRow(row)"
        ng-form="{{formName($index)}}"
        id="{{formName($index)}}"
        ng-class="{ deleted: row.$deleted, 
                    added: row.$added, 
                    selected: row.$selected,
                    focused: row.$focused, 
                    editable: row.$editable || !simpleGrid.options.perRowEditModeEnabled,
                    'not-editable': !row.$editable && simpleGrid.options.perRowEditModeEnabled
                  }"
        ng-include="'sg-row.html'">
    </tr>

    <tr class="sg-dummy-row"
        ng-if="simpleGrid.options.perRowEditModeEnabled"
        ng-init="isDummy = true">
        <td ng-repeat="column in simpleGrid.options.columns"
            ng-init="columnIndex = $index"
            class="sg-data-cell"
            ng-include="'sg-editable-cell.html'">
        </td>
        <td ng-if="simpleGrid.options.showDeleteButton || simpleGrid.options.showEditButton"
            class="sg-actions-cell"
            ng-include="'sg-action-buttons.html'">
        </td>
{'fraction_non_alphanumeric': 0.16637108352335106, 'fraction_numerical': 0.0008445232666159953, 'mean_word_length': 2.38826895565093, 'pattern_counts': {'":': 0, '<': 111, '<?xml version=': 0, '>': 111, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2445263', 'n_tokens_mistral': 3591, 'n_tokens_neox': 3484, 'n_words': 514}