<commit_before>
// xpath for object identification
var x = require('casper').selectXPath;

// assign parameters to p1-p9 variables
var p1 = casper.cli.raw.get(0); var p2 = casper.cli.raw.get(1); var p3 = casper.cli.raw.get(2);
var p4 = casper.cli.raw.get(3); var p5 = casper.cli.raw.get(4); var p6 = casper.cli.raw.get(5);
var p7 = casper.cli.raw.get(6); var p8 = casper.cli.raw.get(7); var p9 = casper.cli.raw.get(8);

// save start time to measure execution time
var automation_start_time = Date.now(); casper.echo('\nSTART - automation started - ' + Date().toLocaleString());

// initialise other global variables
var save_text_count = 0; var snap_image_count = 0;

// muting echo in test automation scripts
function dummy_echo(muted_string) {return;}

// saving text information to file
function save_text(file_name,info_text) {
if (!file_name) {save_text_count++; file_name = flow_path + '/' + 'text' + save_text_count.toString() + '.txt';}
var fs = require('fs'); fs.write(file_name, info_text, 'w');}

// saving snapshots of website to file
function snap_image() {snap_image_count++; return (flow_path + '/' + 'snap' + snap_image_count.toString() + '.png');}

// adding synchronous suspend capability
function sleep(delay_in_ms) {var start_time = new Date().getTime();
for (var sleep_count = 0; sleep_count < 1e7; sleep_count++)
{if ((new Date().getTime() - start_time) > delay_in_ms) break;}}

// checking if selector is css selector
function is_css_selector(selector) {
if (selector.length == 0) return false; if (selector.charAt(0) == '[') return true;
if (selector.charAt(0) == '.') return true; if (selector.charAt(0) == '#') return true;
if (selector.substring(0,4) == 'div ') return true; if (selector.substring(0,4) == 'div:') return true;
if (selector.substring(0,4) == 'div[') return true; if (selector.substring(0,2) == 'p ') return true;
if (selector.substring(0,2) == 'p:') return true; if (selector.substring(0,2) == 'p[') return true;
if (selector.substring(0,6) == 'input ') return true; if (selector.substring(0,6) == 'input:') return true;
if (selector.substring(0,6) == 'input[') return true; if (selector.substring(0,7) == 'button ') return true;
if (selector.substring(0,7) == 'button:') return true; if (selector.substring(0,7) == 'button[') return true;
if (selector.substring(0,3) == 'li ') return true; if (selector.substring(0,3) == 'li:') return true;
if (selector.substring(0,3) == 'li[') return true; if (selector.substring(0,3) == 'tr ') return true;
if (selector.substring(0,3) == 'tr:') return true; if (selector.substring(0,3) == 'tr[') return true;
if (selector.substring(0,5) == 'span ') return true; if (selector.substring(0,5) == 'span:') return true;
if (selector.substring(0,5) == 'span[') return true;
if (selector.substring(0,3) == 'h1 ') return true; if (selector.substring(0,3) == 'h1:') return true;
if (selector.substring(0,3) == 'h1[') return true; if (selector.substring(0,3) == 'h2 ') return true;
if (selector.substring(0,3) == 'h2:') return true; if (selector.substring(0,3) == 'h2[') return true;
if (selector.substring(0,3) == 'h3 ') return true; if (selector.substring(0,3) == 'h3:') return true;
if (selector.substring(0,3) == 'h3[') return true; if (selector.substring(0,3) == 'h4 ') return true;
if (selector.substring(0,3) == 'h4:') return true; if (selector.substring(0,3) == 'h4[') return true;
if (selector.substring(0,3) == 'h5 ') return true; if (selector.substring(0,3) == 'h5:') return true;<commit_msg>fix #12 - css selectors doesn't work?<commit_after>
// xpath for object identification
var x = require('casper').selectXPath;

// assign parameters to p1-p9 variables
var p1 = casper.cli.raw.get(0); var p2 = casper.cli.raw.get(1); var p3 = casper.cli.raw.get(2);
var p4 = casper.cli.raw.get(3); var p5 = casper.cli.raw.get(4); var p6 = casper.cli.raw.get(5);
var p7 = casper.cli.raw.get(6); var p8 = casper.cli.raw.get(7); var p9 = casper.cli.raw.get(8);

// save start time to measure execution time
var automation_start_time = Date.now(); casper.echo('\nSTART - automation started - ' + Date().toLocaleString());

// initialise other global variables
var save_text_count = 0; var snap_image_count = 0;

// muting echo in test automation scripts
function dummy_echo(muted_string) {return;}

// saving text information to file
function save_text(file_name,info_text) {
if (!file_name) {save_text_count++; file_name = flow_path + '/' + 'text' + save_text_count.toString() + '.txt';}
var fs = require('fs'); fs.write(file_name, info_text, 'w');}

// saving snapshots of website to file
function snap_image() {snap_image_count++; return (flow_path + '/' + 'snap' + snap_image_count.toString() + '.png');}

// adding synchronous suspend capability
function sleep(delay_in_ms) {var start_time = new Date().getTime();
for (var sleep_count = 0; sleep_count < 1e7; sleep_count++)
{if ((new Date().getTime() - start_time) > delay_in_ms) break;}}

// checking if selector is css selector
function is_css_selector(selector) { // post-issue #12, function marked for potential deletion
if (selector.length == 0) return false; if (selector.charAt(0) == '[') return true;
if (selector.charAt(0) == '.') return true; if (selector.charAt(0) == '#') return true;
if (selector.substring(0,4) == 'div ') return true; if (selector.substring(0,4) == 'div:') return true;
if (selector.substring(0,4) == 'div[') return true; if (selector.substring(0,2) == 'p ') return true;
if (selector.substring(0,2) == 'p:') return true; if (selector.substring(0,2) == 'p[') return true;
if (selector.substring(0,6) == 'input ') return true; if (selector.substring(0,6) == 'input:') return true;
if (selector.substring(0,6) == 'input[') return true; if (selector.substring(0,7) == 'button ') return true;
if (selector.substring(0,7) == 'button:') return true; if (selector.substring(0,7) == 'button[') return true;
if (selector.substring(0,3) == 'li ') return true; if (selector.substring(0,3) == 'li:') return true;
if (selector.substring(0,3) == 'li[') return true; if (selector.substring(0,3) == 'tr ') return true;
if (selector.substring(0,3) == 'tr:') return true; if (selector.substring(0,3) == 'tr[') return true;
if (selector.substring(0,5) == 'span ') return true; if (selector.substring(0,5) == 'span:') return true;
if (selector.substring(0,5) == 'span[') return true;
if (selector.substring(0,3) == 'h1 ') return true; if (selector.substring(0,3) == 'h1:') return true;
if (selector.substring(0,3) == 'h1[') return true; if (selector.substring(0,3) == 'h2 ') return true;
if (selector.substring(0,3) == 'h2:') return true; if (selector.substring(0,3) == 'h2[') return true;
if (selector.substring(0,3) == 'h3 ') return true; if (selector.substring(0,3) == 'h3:') return true;
if (selector.substring(0,3) == 'h3[') return true; if (selector.substring(0,3) == 'h4 ') return true;
if (selector.substring(0,3) == 'h4:') return true; if (selector.substring(0,3) == 'h4[') return true;
if (selector.substring(0,3) == 'h5 ') return true; if (selector.substring(0,3) == 'h5:') return true;
{'fraction_non_alphanumeric': 0.19274537695590327, 'fraction_numerical': 0.032716927453769556, 'mean_word_length': 5.3976342129208374, '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': '468757', 'n_tokens_mistral': 2471, 'n_tokens_neox': 2449, 'n_words': 673}