<commit_before>package com.example.fw;

import org.openqa.selenium.Alert;
import org.openqa.selenium.By;
import org.openqa.selenium.NoSuchElementException;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.support.ui.Select;

public abstract class HelperBase {

		protected ApplicationManager manager;
		protected WebDriver driver;
		public boolean acceptNextAlert = true;

		public HelperBase(ApplicationManager manager) {
			this.manager = manager;	
			this.driver = manager.driver;
  }
		public boolean isElementPresent(By by) {
		    try {
		      driver.findElement(by);
		      return true;
		    } catch (NoSuchElementException e) {
		      return false;
		    }
		  }

		public String closeAlertAndGetItsText() {
		    try {
		      Alert alert = driver.switchTo().alert();
		      String alertText = alert.getText();
		      if (acceptNextAlert) {
		        alert.accept();
		      } else {
		        alert.dismiss();
		      }
		      return alertText;
		    } finally {
		     acceptNextAlert = true;
		    }
		  }
		protected void type(By locator, String text) {
			if (text != null) {
			driver.findElement(locator).clear();
			driver.findElement(locator).sendKeys(text);
		  }
		}
		protected void click(By locator) {
			driver.findElement(locator).click();
		}
		
		protected void selectByText(By locator, String text) {
			if (text != null) {
			new Select(driver.findElement(locator)).selectByVisibleText(text);
		  }
		}
			
}<commit_msg>add local variable in 'type' method<commit_after>package com.example.fw;

import org.openqa.selenium.Alert;
import org.openqa.selenium.By;
import org.openqa.selenium.NoSuchElementException;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.ui.Select;

public abstract class HelperBase {

		protected ApplicationManager manager;
		protected WebDriver driver;
		public boolean acceptNextAlert = true;

		public HelperBase(ApplicationManager manager) {
			this.manager = manager;	
			this.driver = manager.driver;
  }
		public boolean isElementPresent(By by) {
		    try {
		      driver.findElement(by);
		      return true;
		    } catch (NoSuchElementException e) {
		      return false;
		    }
		  }

		public String closeAlertAndGetItsText() {
		    try {
		      Alert alert = driver.switchTo().alert();
		      String alertText = alert.getText();
		      if (acceptNextAlert) {
		        alert.accept();
		      } else {
		        alert.dismiss();
		      }
		      return alertText;
		    } finally {
		     acceptNextAlert = true;
		    }
		  }
		protected void type(By locator, String text) {
			if (text != null) {
			WebElement elementLocator = driver.findElement(locator);
			elementLocator.clear();
			elementLocator.sendKeys(text);
		  }
		}
		protected void click(By locator) {
			driver.findElement(locator).click();
		}
		
		protected void selectByText(By locator, String text) {
			if (text != null) {
			new Select(driver.findElement(locator)).selectByVisibleText(text);
		  }
		}
			
}
{'fraction_non_alphanumeric': 0.10372077708264735, 'fraction_numerical': 0.0, 'mean_word_length': 2.90990990990991, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '676515', 'n_tokens_mistral': 1074, 'n_tokens_neox': 891, 'n_words': 196}