<commit_before>import java.io.BufferedReader;
import java.io.Reader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
public abstract class ProbabilityCircuit extends Circuit {

    private List<Double> logicalInputProbabilities;
    
    public ProbabilityCircuit(Reader reader) throws IOException {
        String line;
        BufferedReader br = null; 
        try {
            br = new BufferedReader(reader);
            
            logicalInputProbabilities = new ArrayList<Double>();
            while ( (line = br.readLine()) != null ) {
                double probabilityBeingActive = Double.parseDouble(line);
                logicalInputProbabilities.add(probabilityBeingActive);            
            }//while
            boolean[] inputs = new boolean[logicalInputProbabilities.size()];
            this.setInputs(inputs);
        }//try
        finally {
            if (br != null)
                br.close();
        }
    }//ProbabilityCircuit
    
    public void generateInputs() {
        
        for (int i = 0; i < logicalInputProbabilities.size(); i++) {
            boolean state = Math.random() < logicalInputProbabilities.get(i);
            this.setInput(i, state);
        }//for
        
    }//generateInputs
    
}

abstract class Circuit implements Logical {
    private boolean[] inputs;
    private boolean[] outputs;
    
    public abstract boolean[] logicalFunction();
    public abstract void generateInputs();
    
    public void setInputs(boolean... inputs) {
        this.inputs = inputs;
    }//setInputs
    
    public void setInput(int i, boolean state) {
        inputs[i] = state;
    }
    
    public boolean[] getInputs() {
        return this.inputs;
    }
    
    public void setOutputs(boolean[] outputs) {
        this.outputs = outputs;
    }
    public boolean[] getOutputs() {
        return this.outputs;
    }
    
    public void activate() {
        this.generateInputs();
        outputs = logicalFunction();
        this.generateReport();
    }//activate
    
    public void generateReport() {
        for (int i = 0; i < inputs.length || i < inputs.length; i++) {
            if (i >= inputs.length)
                System.out.print(" ------>");
            else
                System.out.print(inputs[i] + "------>");
            if (i >= outputs.length)
                System.out.println();
            else<commit_msg>Bug fix, thanks to Lambros Petrou, in the printing<commit_after>import java.io.BufferedReader;
import java.io.Reader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
public abstract class ProbabilityCircuit extends Circuit {

    private List<Double> logicalInputProbabilities;
    
    public ProbabilityCircuit(Reader reader) throws IOException {
        String line;
        BufferedReader br = null; 
        try {
            br = new BufferedReader(reader);
            
            logicalInputProbabilities = new ArrayList<Double>();
            while ( (line = br.readLine()) != null ) {
                double probabilityBeingActive = Double.parseDouble(line);
                logicalInputProbabilities.add(probabilityBeingActive);            
            }//while
            boolean[] inputs = new boolean[logicalInputProbabilities.size()];
            this.setInputs(inputs);
        }//try
        finally {
            if (br != null)
                br.close();
        }
    }//ProbabilityCircuit
    
    public void generateInputs() {
        
        for (int i = 0; i < logicalInputProbabilities.size(); i++) {
            boolean state = Math.random() < logicalInputProbabilities.get(i);
            this.setInput(i, state);
        }//for
        
    }//generateInputs
    
}

abstract class Circuit implements Logical {
    private boolean[] inputs;
    private boolean[] outputs;
    
    public abstract boolean[] logicalFunction();
    public abstract void generateInputs();
    
    public void setInputs(boolean... inputs) {
        this.inputs = inputs;
    }//setInputs
    
    public void setInput(int i, boolean state) {
        inputs[i] = state;
    }
    
    public boolean[] getInputs() {
        return this.inputs;
    }
    
    public void setOutputs(boolean[] outputs) {
        this.outputs = outputs;
    }
    public boolean[] getOutputs() {
        return this.outputs;
    }
    
    public void activate() {
        this.generateInputs();
        outputs = logicalFunction();
        this.generateReport();
    }//activate
    
    public void generateReport() {
        for (int i = 0; i < inputs.length || i < outputs.length; i++) {
            if (i >= inputs.length)
                System.out.print(" ------>");
            else
                System.out.print(inputs[i] + "------>");
            if (i >= outputs.length)
                System.out.println();
            else
{'fraction_non_alphanumeric': 0.11042944785276074, 'fraction_numerical': 0.0008179959100204499, 'mean_word_length': 1.8923713778829094, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, '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': '6690230', 'n_tokens_mistral': 1304, 'n_tokens_neox': 1270, 'n_words': 319}