<commit_before>package masterGraphMakers;

import JpAws.S3MasterInputMaker;
import java.io.*;
import static java.lang.System.err;
import static java.lang.System.exit;
import java.util.logging.Level;
import java.util.logging.Logger;
import system.FileSystem;
import system.MasterGraphMaker;

/**
 *
 * @author <NAME>
 */
public class G1MasterGraphMaker implements MasterGraphMaker {

    /**
     *
     */
    @Override
    public void make(FileSystem fileSystem, int numWorkers) {
        int fis_used = 0;
        BufferedReader bufferedReader = null;
        DataInputStream dataInputStream = null;
        FileInputStream fileInputStream = null;
        String jobDirectoryName = null;

        boolean isEc2 = fileSystem.getFileSystem();
        if (isEc2) {
            //System.out.println(" G1MasterGraphMaker.read() : jus entered isEc2") ;
            jobDirectoryName = fileSystem.getJobDirectory();
            S3MasterInputMaker masterFileMaker = new S3MasterInputMaker();
            bufferedReader = masterFileMaker.FileInput(jobDirectoryName);
            //System.out.println(" G1MasterGraphMaker.read() : exiting isEc2" + jobDirectoryName) ;
        } else {
            // make file
            fis_used = 1;
            try {
                fileInputStream = fileSystem.getFileInputStream();
            } catch (FileNotFoundException ex) {
                System.out.println("Failed getting local file input stream");
                System.exit(1);
            }
            dataInputStream = new DataInputStream(fileInputStream);
            bufferedReader = new BufferedReader(new InputStreamReader(dataInputStream));
        }
        String line = null;
        try {
            while ((line = bufferedReader.readLine()) == null) {
                err.println("WorkerFileWriter1: Error: input file has no lines.");
                exit(1);
            }
        } catch (IOException ex) {
            Logger.getLogger(G1MasterGraphMaker.class.getName()).log(Level.SEVERE, null, ex);
        }
        int numV = Integer.parseInt(line);
        if (fis_used == 1) {
            try {
                fileInputStream.close();
                dataInputStream.close();
            } catch (IOException ex) {
                Logger.getLogger(G1MasterGraphMaker.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
        int vertexNum = 0;
        int fileNum;
        for (fileNum = 1; fileNum <= numWorkers; fileNum++) {
            // open file for output in "in" directory
            //System.out.println(" G1MasterGraphMaker.read() 2: jus entered isEc2") ;
            FileOutputStream fileOutputStream = null;
            try {
                fileOutputStream = fileSystem.getWorkerInputFileOutputStream(fileNum);
            } catch (FileNotFoundException ex) {
                Logger.getLogger(G1MasterGraphMaker.class.getName()).log(Level.SEVERE, null, ex);
            }
            DataOutputStream dataOutputStream = new DataOutputStream(fileOutputStream);
            BufferedWriter bufferedWriter = new BufferedWriter(new OutputStreamWriter(dataOutputStream));

            int linesPerFile = numV / numWorkers;
            if (fileNum <= numV % numWorkers) {
                linesPerFile++;
            }

            for (int lineNum = 0; lineNum < linesPerFile; lineNum++) {
                // create line for vertex whose number is vertexNum
                StringBuffer stringBuffer = new StringBuffer();
                stringBuffer.append(vertexNum).append(' ');
                for (int targetVertexNum = vertexNum + 1; targetVertexNum < numV; targetVertexNum++) {
                    stringBuffer.append(targetVertexNum).append(' ');
                    int value = (targetVertexNum == vertexNum + 1) ? -1 : 1;
                    stringBuffer.append(value).append(' ');
                }
                String lines = new String(stringBuffer);
                try {
                    // append line to output file
                    bufferedWriter.write(lines);
                    bufferedWriter.newLine();
                } catch (IOException ex) {
                    Logger.getLogger(G1MasterGraphMaker.class.getName()).log(Level.SEVERE, null, ex);
                }
                vertexNum++;
            }
            try {
                bufferedWriter.close();
                dataOutputStream.close();
                fileOutputStream.close();
            } catch (IOException ex) {
                Logger.getLogger(G1MasterGraphMaker.class.getName()).log(Level.SEVERE, null, ex);
            }

            if (isEc2) {
                S3MasterInputMaker masterFileMaker = new S3MasterInputMaker(fileNum);
                masterFileMaker.UploadFilesOntoS3(jobDirectoryName);
                //System.out.println(" I have uploaded IN/ worker files the files onto S3 : G1MasterGraphMaker.read() " + jobDirectoryName + fileNum) ; 
            }
        }  
        try {
            bufferedReader.close();
        } catch (IOException ex) {
            Logger.getLogger(G1MasterGraphMaker.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
}<commit_msg>Reset back to how it was.<commit_after>package masterGraphMakers;

import static java.lang.System.err;
import static java.lang.System.exit;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import system.FileSystem;
import system.MasterGraphMaker;
import JpAws.S3FileSys; 
import JpAws.S3MasterInputMaker;

/**
 *
 * @author <NAME>
 */
public class G1MasterGraphMaker implements MasterGraphMaker
{

    /**
	 * 
	 */
	@Override
    public void make(FileSystem fileSystem, int numWorkers) 
    {
        try
        {
        	int fis_used = 0 ; 
            BufferedReader bufferedReader = null ; 
        	DataInputStream dataInputStream =null ; 
        	FileInputStream fileInputStream = null ;        	
        	String jobDirectoryName = null ; 

            boolean isEc2 = fileSystem.getFileSystem() ; 
        	if (isEc2) {
        		//System.out.println(" G1MasterGraphMaker.read() : jus entered isEc2") ;
        		jobDirectoryName = fileSystem.getJobDirectory() ; 
        		S3MasterInputMaker masterFileMaker = new S3MasterInputMaker () ; 
        		bufferedReader = masterFileMaker.FileInput(jobDirectoryName) ;  
        		//System.out.println(" G1MasterGraphMaker.read() : exiting isEc2" + jobDirectoryName) ;
        	}
            else
            {
            // make file
            fis_used = 1 ; 
            fileInputStream = fileSystem.getFileInputStream();
            dataInputStream = new DataInputStream( fileInputStream );
            bufferedReader = new BufferedReader(new InputStreamReader( dataInputStream ) ); 
            } 
            String line;
            while ( ( line = bufferedReader.readLine() ) == null )
            {
                err.println( "WorkerFileWriter1: Error: input file has no lines." );
                exit( 1 );
            }
            int numV = Integer.parseInt( line ); 
            if(fis_used == 1 )
            {
            	fileInputStream.close() ; 
                dataInputStream.close();
            }
            int vertexNum = 0;
            int fileNum;
            for ( fileNum = 1; fileNum <= numWorkers; fileNum++ )
            {
                // open file for output in "in" directory
            	//System.out.println(" G1MasterGraphMaker.read() 2: jus entered isEc2") ;
                FileOutputStream fileOutputStream = fileSystem.getWorkerInputFileOutputStream( fileNum );
                DataOutputStream dataOutputStream = new DataOutputStream( fileOutputStream );
                BufferedWriter bufferedWriter = new BufferedWriter( new OutputStreamWriter( dataOutputStream ) );
                
                int linesPerFile = numV / numWorkers;
                if ( fileNum <= numV % numWorkers )
                {
                    linesPerFile++;
                }
                
                for ( int lineNum = 0; lineNum < linesPerFile; lineNum++ )
                {
                    // create line for vertex whose number is vertexNum
                    StringBuffer stringBuffer = new StringBuffer();
                    stringBuffer.append( vertexNum ).append( ' ' );
                    for ( int targetVertexNum = vertexNum + 1; targetVertexNum < numV; targetVertexNum++ )
                    {
                        stringBuffer.append( targetVertexNum ).append( ' ' );
                        int value = ( targetVertexNum == vertexNum + 1 ) ? -1 : 1;
                        stringBuffer.append( value ).append( ' ' );
                    }
                    String lines = new String( stringBuffer );

                    // append line to output file
                    bufferedWriter.write( lines );
                    bufferedWriter.newLine();
                    vertexNum++;
                }
                
                bufferedWriter.close();
                dataOutputStream.close();
                fileOutputStream.close(); 
                if(isEc2)
                { 
            	S3MasterInputMaker masterFileMaker = new S3MasterInputMaker (fileNum) ; 
                masterFileMaker.UploadFilesOntoS3(jobDirectoryName) ; 
                //System.out.println(" I have uploaded IN/ worker files the files onto S3 : G1MasterGraphMaker.read() " + jobDirectoryName + fileNum) ; 
                }  
                // close output file
                    
            }   // for ending
                     
           // System.out.println(" I print this one, G1Graphmaker.read()1 : " ) ; 
            bufferedReader.close();
            //System.out.println(" I print this one, G1Graphmaker.read()2 : " ) ; 
            //System.out.println(" I print this one, G1Graphmaker.read()3 : " ) ; 
            //System.out.println("exiting the make function of G1MasterGraphMaker") ;  

        }              //try ending
        catch ( Exception exception )
        {
            err.println( "G1MasterGraphMaker.read: Error:is happening here damm " + exception.getMessage() );
            exit( 1 );
        }

    }
}
{'fraction_non_alphanumeric': 0.09297820823244551, 'fraction_numerical': 0.007651331719128329, 'mean_word_length': 1.745546397234778, 'pattern_counts': {'":': 0, '<': 13, '<?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': '2015055', 'n_tokens_mistral': 2728, 'n_tokens_neox': 2559, 'n_words': 587}