<commit_before>package org.intermine.web;

/*
 * Copyright (C) 2002-2005 FlyMine
 *
 * This code may be freely distributed and modified under the
 * terms of the GNU Lesser General Public Licence.  This should
 * be distributed with the code.  See the LICENSE file for more
 * information or http://www.gnu.org/copyleft/lesser.html.
 *
 */

import org.intermine.objectstore.query.Results;

import java.io.Writer;
import java.io.IOException;

/**
 * RunQueryMonitor that writes repeatedly to an http response output stream
 * while a query runs and cancels the query if an error occurs while writing
 * to the client.
 *
 * @author <NAME>
 */
public class RunQueryMonitorDots implements RunQueryMonitor
{
    /** Number of times queryProgress has been called. */
    //protected int tickCount = 0;
    /** Writer to draw progress dots to. */
    protected Writer writer;
    
    /**
     * Construct a new instance of RunQueryMonitorDots.
     *
     * @param writer the http response output stream writer 
     */
    public RunQueryMonitorDots(Writer writer) {
        this.writer = writer;
    }
    
    /**
     * Called intermittently while a query is run.
     *
     * @param results  the Results object associated with the running query
     */
    public void queryProgress(Results results) {
        tickCount++;
        try {
            //if (tickCount % 40 == 0) {
            //    writer.write("<br>");
            //}
            writer.write(". ");
            writer.flush();
        } catch (IOException _) {
            cancelQuery(results);
        }
    }
    
    /**
     * Cancel a query given a Results object.
     *
     * @param results  the Results object associated with the running query
     */
    public void cancelQuery(Results results) {
        // write me
    }
    
    /**
     * Forward the client to another URL.
     *
     * @param url the URL to forward to
     * @throws IOException if writing to the response stream fails
     */
    public void forwardClient(String url) throws IOException {
        writer.write("<script language=\"JavaScript\">document.location=\"" + url + "\"</script>\n\n");
        writer.flush();
    }
}
<commit_msg>Spaces between dots.<commit_after>package org.intermine.web;

/*
 * Copyright (C) 2002-2005 FlyMine
 *
 * This code may be freely distributed and modified under the
 * terms of the GNU Lesser General Public Licence.  This should
 * be distributed with the code.  See the LICENSE file for more
 * information or http://www.gnu.org/copyleft/lesser.html.
 *
 */

import org.intermine.objectstore.query.Results;

import java.io.Writer;
import java.io.IOException;

/**
 * RunQueryMonitor that writes repeatedly to an http response output stream
 * while a query runs and cancels the query if an error occurs while writing
 * to the client.
 *
 * @author <NAME>
 */
public class RunQueryMonitorDots implements RunQueryMonitor
{
    /** Number of times queryProgress has been called. */
    //protected int tickCount = 0;
    /** Writer to draw progress dots to. */
    protected Writer writer;
    
    /**
     * Construct a new instance of RunQueryMonitorDots.
     *
     * @param writer the http response output stream writer 
     */
    public RunQueryMonitorDots(Writer writer) {
        this.writer = writer;
    }
    
    /**
     * Called intermittently while a query is run.
     *
     * @param results  the Results object associated with the running query
     */
    public void queryProgress(Results results) {
        //tickCount++;
        try {
            //if (tickCount % 40 == 0) {
            //    writer.write("<br>");
            //}
            writer.write(". ");
            writer.flush();
        } catch (IOException _) {
            cancelQuery(results);
        }
    }
    
    /**
     * Cancel a query given a Results object.
     *
     * @param results  the Results object associated with the running query
     */
    public void cancelQuery(Results results) {
        // write me
    }
    
    /**
     * Forward the client to another URL.
     *
     * @param url the URL to forward to
     * @throws IOException if writing to the response stream fails
     */
    public void forwardClient(String url) throws IOException {
        writer.write("<script language=\"JavaScript\">document.location=\"" + url + "\"</script>\n\n");
        writer.flush();
    }
}

{'fraction_non_alphanumeric': 0.09820004556846662, 'fraction_numerical': 0.005468215994531784, 'mean_word_length': 2.237463126843658, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '372884', 'n_tokens_mistral': 1190, 'n_tokens_neox': 1150, 'n_words': 418}