<commit_before><?php
/**
 * @author <NAME> <<EMAIL>>
 */

namespace Acceptie;

class Browser {

    /**
     * @var \RemoteWebDriver
     */
    private $_driver;

    /**
     * @param \RemoteWebDriver $driver
     */
    public function __construct(\RemoteWebDriver $driver) {
        $this->_driver = $driver;
    }

    /**
     * @param string $url
     */
    public function open($url) {
        $this->_driver->get($url);
    }

    /**
     * @return string
     */
    public function getPageTitle() {
        return $this->_driver->getTitle();
    }

    /**
     * @return string
     */
    public function getPageUrl() {
        return $this->_driver->getCurrentURL();
    }

    /**
     * @param string $selector
     * @param string $text
     */
    public function inputText($selector, $text) {
        $this->click($selector);
        $this->clearInput($selector);
        $this->pressKey($selector, $text);
    }

    /**
     * @param string $selector
     * @param string $keys
     */
    public function pressKey($selector, $keys) {
        foreach ($this->_getElements($selector) as $element) {
            $element->sendKeys($keys);
        }
    }

    /**
     * @param string $selector
     */
    public function clearInput($selector) {
        foreach ($this->_getElements($selector) as $element) {
            $element->clear();
        }
    }

    /**
     * @param string $selector
     */
    public function click($selector) {
        foreach ($this->_getElements($selector) as $element) {
            $element->click();
        }
    }

    /**
     * @param string $selector
     * @return \RemoteWebElement[]
     */
    private function _getElement($selector) {
        if ($this->_isXPathSelector($selector)) {
            return $this->_driver->findElement(\WebDriverBy::xpath($selector));
        } else {
            return $this->_driver->findElement(\WebDriverBy::cssSelector($selector));
        }
    }

    /**
     * @param string $selector
     * @return \RemoteWebElement[]
     */<commit_msg>Progress<commit_after><?php
/**
 * @author <NAME> <<EMAIL>>
 */

namespace Acceptie;

class Browser {

    /**
     * @var \RemoteWebDriver
     */
    private $_driver;

    /**
     * @param \RemoteWebDriver $driver
     */
    public function __construct(\RemoteWebDriver $driver) {
        $this->_driver = $driver;
    }

    /**
     * @param string $url
     */
    public function open($url) {
        $this->_driver->get($url);
    }

    /**
     * @return string
     */
    public function getPageTitle() {
        return $this->_driver->getTitle();
    }

    /**
     * @return string
     */
    public function getPageUrl() {
        return $this->_driver->getCurrentURL();
    }

    /**
     * @param string $selector
     * @param string $text
     */
    public function inputText($selector, $text) {
        $this->click($selector);
        $this->clearInput($selector);
        $this->pressKey($selector, $text);
    }

    /**
     * @param string $selector
     * @param string $keys
     */
    public function pressKey($selector, $keys) {
        foreach ($this->_getElements($selector) as $element) {
            $element->sendKeys($keys);
        }
    }

    /**
     * @param string $selector
     */
    public function clearInput($selector) {
        foreach ($this->_getElements($selector) as $element) {
            $element->clear();
        }
    }

    /**
     * @param string $selector
     */
    public function click($selector) {
        foreach ($this->_getElements($selector) as $element) {
            $element->click();
        }
    }

    /**
     * @param string $selector
     */
    public function submit($selector) {
        $this->_getElement($selector)->submit();
    }

    /**
     * @param string $selector
     * @return \RemoteWebElement
     */
    private function _getElement($selector) {
        if ($this->_isXPathSelector($selector)) {
            return $this->_driver->findElement(\WebDriverBy::xpath($selector));
        } else {
            return $this->_driver->findElement(\WebDriverBy::cssSelector($selector));
        }
    }

    /**
     * @param string $selector
     * @return \RemoteWebElement[]
     */
{'fraction_non_alphanumeric': 0.15602836879432624, 'fraction_numerical': 0.0, 'mean_word_length': 1.9753867791842474, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 53, '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': '739019', 'n_tokens_mistral': 1206, 'n_tokens_neox': 1184, 'n_words': 233}