<commit_before>package org.openqa.selenium.environment;

import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.ProcessingInstruction;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;

import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;

public class StatisticCommands {

  private HashMap<String, CommandData> executedCommandMap;

  public StatisticCommands() {
    executedCommandMap = new HashMap<String, CommandData>();
  }

  public void addCommand(String commandName, String url, String method, String[] test) {
    if (!executedCommandMap.containsKey(commandName)) {
      executedCommandMap.put(commandName, new CommandData(commandName, url, method, test));
    } else {
      executedCommandMap.get(commandName).addTestCases(test);
    }
  }

  public void writeToXml(String testsName) {
    try {
      File outFile = new File("build/test_logs/" + testsName + "_CommandReport.xml");
      outFile.mkdirs();
      if (outFile.exists()) {
        outFile.delete();
      }
<commit_msg>fixed duplicating testcases in xml report<commit_after>package org.openqa.selenium.environment;

import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.ProcessingInstruction;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;

import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;

public class StatisticCommands {

  private HashMap<String, CommandData> executedCommandMap;

  public StatisticCommands() {
    executedCommandMap = new HashMap<String, CommandData>();
  }

  public void addCommand(String commandName, String url, String method, String[] test) {
    if (!executedCommandMap.containsKey(commandName)) {
      executedCommandMap.put(commandName, new CommandData(commandName, url, method, test));
    } else {
      CommandData data = executedCommandMap.get(commandName);
      if (!data.getTestCases().contains(test)) {
          data.addTestCases(test);
        }
    }
  }

  public void writeToXml(String testsName) {
    try {
      File outFile = new File("build/test_logs/" + testsName + "_CommandReport.xml");
      outFile.mkdirs();
      if (outFile.exists()) {
        outFile.delete();
      }

{'fraction_non_alphanumeric': 0.10599226804123711, 'fraction_numerical': 0.0019329896907216496, 'mean_word_length': 4.771375464684015, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 19}, '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': '2278103', 'n_tokens_mistral': 900, 'n_tokens_neox': 897, 'n_words': 182}