<commit_before>'''
Created on Nov 14, 2014
Copied from GitHubResearchDataMiner

@author: bgt
'''

import ConfigParser
import os
import sys
import time
import CsvDao
import GitHubDao

config = ConfigParser.ConfigParser()
config.readfp(open(os.path.dirname(__file__)+'/config.cfg'))

def announceRunTimeFromSeconds(seconds):
    actualSeconds = seconds-60*int(seconds/60)
    actualMinutes = int((seconds-360*int(seconds/360))/60)
    actualHours   = int(seconds/21600)
    outputString = "Run time:"
    if actualHours>0:
        outputString += " "+str(actualHours)+" hours"
    if actualMinutes>0:
        outputString += " "+str(actualMinutes)+" minutes"
    if actualSeconds>0:
        outputString += " "+str(actualSeconds)+" seconds"
    print outputString
    
def printHowToUse():
    print "Usage: python NonSomeFinder.py searchword"

if __name__ == '__main__':
    if len(sys.argv) != 2:<commit_msg>Clarifying the code that counts total run time. Hopefully fixed the inherent bug also, where run time is reported far too short from actual.<commit_after>'''
Created on Nov 14, 2014
Copied from GitHubResearchDataMiner

@author: bgt
'''

import ConfigParser
import os
import sys
import time
import CsvDao
import GitHubDao

config = ConfigParser.ConfigParser()
config.readfp(open(os.path.dirname(__file__)+'/config.cfg'))

def announceRunTimeFromSeconds(seconds):
    remains = seconds
    actualSeconds = remains-60*int(remains/60) #remove full minutes and bigger
    remains -= actualSeconds
    actualMinutes = int((remains-360*int(remains/360))/60) #remove full hours and covert seconds to minutes
    remains -= actualMinutes*60
    actualHours   = int(remains/21600) #convert seconds to hours
    outputString = "Run time:"
    if actualHours>0:
        outputString += " "+str(actualHours)+" hours"
    if actualMinutes>0:
        outputString += " "+str(actualMinutes)+" minutes"
    if actualSeconds>0:
        outputString += " "+str(actualSeconds)+" seconds ("+seconds+" total seconds)"
    print outputString
    
def printHowToUse():
    print "Usage: python NonSomeFinder.py searchword"

if __name__ == '__main__':
    if len(sys.argv) != 2:
{'fraction_non_alphanumeric': 0.11198519204072188, 'fraction_numerical': 0.025913928736695974, 'mean_word_length': 4.286063569682152, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '503102', 'n_tokens_mistral': 694, 'n_tokens_neox': 654, 'n_words': 182}