<commit_before>#!/usr/bin/python

# Author: <NAME>
# Calculate some graph invariants on big and small graphs
# Date: 5 Sept 2012

import os
import argparse
import unittesting

# Invariant imports
from getBaseName import getBaseName
from loadAdjMatrix import loadAdjMat
from maxavgdeg import getMaxAveDegree
from scanstat_degr import calcScanStat_Degree
from triCount import eignTriangleLocal
from clustCoeff import calcLocalClustCoeff
from loadAdjMatrix import loadAdjMat
  
def realgraph(G_fn, lcc_fn, toDir, roiRootName = None):
  
  G = loadAdjMat(G_fn, lcc_fn, roiRootName) # load up graph into main mem
  
  eignTriangleLocal(G_fn, G, lcc_fn, roiRootName, triDir, None)
  MADdir, eigvDir, ssDir, degDir, triDir, ccDir = createInvDirs(toDir)
  mad = getMaxAveDegree(G_fn, G, lcc_fn, roiRootName, MADdir, eigvDir, True)
  ss1_fn, deg_fn, numNodes = calcScanStat_Degree(G_fn, G, lcc_fn, roiRootName, ssDir, degDir)
  ccArr_fn = calcLocalClustCoeff(deg_fn, tri_fn, None, None, ccDir, False)
  
#************************#
# Create Invariate Dirs  #
#************************#

def createInvDirs(toDir):
  #Maximum Avearage Degree
  MADdir = os.path.join(toDir, "MAD")
  if not os.path.exists(MADdir):
    os.makedirs(MADdir)
  
  # Eigenvalues 
  eigvDir = os.path.join(toDir, "Eigen")
  if not os.path.exists(eigvDir):
    os.makedirs(eigvDir)
  <commit_msg>Moved triCount behind creareDirs<commit_after>#!/usr/bin/python

# Author: <NAME>
# Calculate some graph invariants on big and small graphs
# Date: 5 Sept 2012

import os
import argparse
import unittesting

# Invariant imports
from getBaseName import getBaseName
from loadAdjMatrix import loadAdjMat
from maxavgdeg import getMaxAveDegree
from scanstat_degr import calcScanStat_Degree
from triCount import eignTriangleLocal
from clustCoeff import calcLocalClustCoeff
from loadAdjMatrix import loadAdjMat
  
def realgraph(G_fn, lcc_fn, toDir, roiRootName = None):
  
  G = loadAdjMat(G_fn, lcc_fn, roiRootName) # load up graph into main mem
  
  
  MADdir, eigvDir, ssDir, degDir, triDir, ccDir = createInvDirs(toDir)
  eignTriangleLocal(G_fn, G, lcc_fn, roiRootName, triDir, None)
  mad = getMaxAveDegree(G_fn, G, lcc_fn, roiRootName, MADdir, eigvDir, True)
  ss1_fn, deg_fn, numNodes = calcScanStat_Degree(G_fn, G, lcc_fn, roiRootName, ssDir, degDir)
  ccArr_fn = calcLocalClustCoeff(deg_fn, tri_fn, None, None, ccDir, False)
  
#************************#
# Create Invariate Dirs  #
#************************#

def createInvDirs(toDir):
  #Maximum Avearage Degree
  MADdir = os.path.join(toDir, "MAD")
  if not os.path.exists(MADdir):
    os.makedirs(MADdir)
  
  # Eigenvalues 
  eigvDir = os.path.join(toDir, "Eigen")
  if not os.path.exists(eigvDir):
    os.makedirs(eigvDir)
  
{'fraction_non_alphanumeric': 0.11824817518248175, 'fraction_numerical': 0.004379562043795621, 'mean_word_length': 5.301149425287356, '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': '6630848', 'n_tokens_mistral': 1071, 'n_tokens_neox': 1038, 'n_words': 259}