<commit_before>package com.spinnerconsulting;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.util.Iterator;

import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.util.NumberToTextConverter;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;

public class Excel {

	public static final int NO_RECORD_LIMIT = -1;

	private int maxRecords = NO_RECORD_LIMIT;
	private WebDriver wd;

	void runQueries() throws Exception {

		InputStream inp = new FileInputStream("extras/demo.xlsx");
		XSSFWorkbook wb = new XSSFWorkbook(inp);
		XSSFSheet sheet = wb.getSheetAt(0);

		Iterator<Row> rowIterator = sheet.iterator();

		// Traversing over each row of XLSX file
		while (rowIterator.hasNext()) {
			Row row = rowIterator.next();
			// For each row, iterate through each columns
			Cell cell = row.getCell(2);

			switch (cell.getCellType()) {
			case Cell.CELL_TYPE_STRING:
				System.out.print(cell.getStringCellValue() + "\t");
				break;
			case Cell.CELL_TYPE_NUMERIC:
				String cellValue = NumberToTextConverter.toText(cell.getNumericCellValue());
				System.out.print(cellValue + "\t");
				
				Cell cell2 = row.createCell(3);
				cell2.setCellType(Cell.CELL_TYPE_BOOLEAN);
				cell2.setCellValue(wd.valueExists(cellValue));
				break;
			case Cell.CELL_TYPE_BOOLEAN:
				System.out.print(cell.getBooleanCellValue() + "\t");
				break;
			default:
			}

			System.out.println("");

		}

		inp.close();

		FileOutputStream os = new FileOutputStream("extras/demo.xlsx");
		wb.write(os);
		os.close();
		wd.close();

	}

	public void setMaxRecords(int i) {
		maxRecords = i;
	}

	public void setWebDriver(WebDriver s) {
		wd = s;
	}

	public static void main(String[] args) throws Exception {
		Excel e = new Excel();
		e.runQueries();
	}
<commit_msg>cell exception handling, write True<commit_after>package com.spinnerconsulting;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.util.Iterator;

import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.util.NumberToTextConverter;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;

public class Excel {

	public static final int NO_RECORD_LIMIT = -1;

	private int maxRecords = NO_RECORD_LIMIT;
	private WebDriver wd;

	void runQueries() throws Exception {

		InputStream inp = new FileInputStream("extras/demo.xlsx");
		XSSFWorkbook wb = new XSSFWorkbook(inp);
		XSSFSheet sheet = wb.getSheetAt(0);

		Iterator<Row> rowIterator = sheet.iterator();
		
		// Traversing over each row of XLSX file
		while (rowIterator.hasNext()) {
			Row row = rowIterator.next();
		
			// For each row, iterate through each columns
			
			Cell cell = row.getCell(2);
		
			boolean value;
			
			if (cell != null && cell.getCellType() == Cell.CELL_TYPE_NUMERIC) {
				
				String cellValue = NumberToTextConverter.toText(cell.getNumericCellValue());
				Cell cell2 = row.createCell(3);
				cell2.setCellValue("True");
				
				//System.out.println("CellValue " + cellValue + "\t");
				//System.out.println(wd.valueExists("222"));
				//value is null, cant figure out why.
				//value = wd.valueExists(cellValue);
				
			}else if (cell != null && cell.getCellType() == Cell.CELL_TYPE_STRING && cell.toString() != "Number"){
				String cellValue = (cell.getStringCellValue());
				Cell cell2 = row.createCell(3);
				cell2.setCellValue("True");
			}else if(cell != null && cell.getCellType() == Cell.CELL_TYPE_BOOLEAN){
				boolean cellValue =(cell.getBooleanCellValue());
				Cell cell2 = row.createCell(3);
				cell2.setCellValue("True");
			}else if(cell != null && cell.getCellType() == Cell.CELL_TYPE_BLANK){
				System.out.println("BLANK VALUE");
			}else if(cell != null && cell.getCellType() == Cell.CELL_TYPE_ERROR){
				byte cellValue =(cell.getErrorCellValue());
				System.out.println(cellValue);
			}else if(cell != null && cell.getCellType() == Cell.CELL_TYPE_FORMULA){
				System.out.println("Formula");
			}
			
			else{
				System.out.println(cell);
				
			}

			System.out.println("");
		
		}
		//
		
		inp.close();

		FileOutputStream os = new FileOutputStream("extras/demo.xlsx");
		wb.write(os);
		os.close();		
		wd.close();

	}

	public void setMaxRecords(int i) {
		maxRecords = i;
	}
	
	public void setWebDriver(WebDriver s) {
		wd = s;
		
	}

	public static void main(String[] args) throws Exception {
		Excel e = new Excel();
		e.runQueries();
	}

{'fraction_non_alphanumeric': 0.13406974225687676, 'fraction_numerical': 0.004764998917045701, 'mean_word_length': 3.805411030176899, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '2747769', 'n_tokens_mistral': 1834, 'n_tokens_neox': 1586, 'n_words': 326}