<commit_before>import scipy.io as sio
import sys
from glob import glob
import os
import numpy as np


def graphIsUpperTri():
  
  f = open("SymmetryResults.txt",'w')
  for gr in glob(os.path.join(sys.argv[1],'*')):
    
    idStmt = "Assessing " + gr
    print idStmt
    f.write("\n\n" + idStmt + "\n")
    
    G = sio.loadmat(gr)['fibergraph']
    
    if (G.shape[0] != G.shape[1]):
      alertStmt =  gr + " has unequal rows and columns"
      debugStmt = gr + " rows = %d and cols = %d" % (G.shape[0], G.shape[1])
      print alertStmt
      print debugStmt
      f.write(alertStmt+"\n")
      f.write(debugStmt+"\n")
      
    for row in G.indices:
      nodeNonzero = G[row,:].nonzero()[1]
    
      errorNodes = nodeNonzero[np.where(nodeNonzero <= row)]   
      if errorNodes.shape[0] == 0:
        f.write( str(row) +" node OK!\n")
      else:
        for col in errorNodes:
          fatalStmt =  "Error row:%d , col:%d > 0" % (row, col)
          print fatalStmt
          f.write(fatalStmt +"\n")
    
    finishStmt = gr + " completed"
    print finishStmt
    f.write(finishStmt + "\n")
  
  f.close()
  
if __name__ == '__main__':
  graphIsUpperTri()<commit_msg>Bug fix duplicate nodes<commit_after>import scipy.io as sio
import sys
from glob import glob
import os
import numpy as np


def graphIsUpperTri():
  
  f = open("SymmetryResults.txt",'w')
  for gr in glob(os.path.join(sys.argv[1],'*')):
    
    idStmt = "Assessing " + gr
    print idStmt
    f.write("\n\n" + idStmt + "\n")
    
    G = sio.loadmat(gr)['fibergraph']
    
    if (G.shape[0] != G.shape[1]):
      alertStmt =  gr + " has unequal rows and columns"
      debugStmt = gr + " rows = %d and cols = %d" % (G.shape[0], G.shape[1])
      print alertStmt
      print debugStmt
      f.write(alertStmt+"\n")
      f.write(debugStmt+"\n")
      
    unqInd = np.unique(G.indices)
    for row in unqInd:
      nodeNonzero = G[row,:].nonzero()[1]
    
      errorNodes = nodeNonzero[np.where(nodeNonzero <= row)]   
      if errorNodes.shape[0] == 0:
        f.write( str(row) +" node OK!\n")
      else:
        for col in errorNodes:
          fatalStmt =  "Error row:%d , col:%d > 0" % (row, col)
          print fatalStmt
          f.write(fatalStmt +"\n")
    
    finishStmt = gr + " completed"
    print finishStmt
    f.write(finishStmt + "\n")
  
  f.close()
  
if __name__ == '__main__':
  graphIsUpperTri()
{'fraction_non_alphanumeric': 0.15147732001664585, 'fraction_numerical': 0.00749063670411985, 'mean_word_length': 2.2841530054644807, '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': '6944746', 'n_tokens_mistral': 883, 'n_tokens_neox': 899, 'n_words': 210}