<commit_before>from hibpAPI import *

begin = time.time()

## hard-coded email address for testing purposes
#email = "<EMAIL>"

auth = AuthToken()
prop = ID()

### [resource = ] Sets API URI
emailCount = 0
breachList = []
methods = Methods()
with open(sys.argv[1]) as f:
    for line in f:
        line = line.strip()
        ### Need to slow it down a little so it doesn't trip Cloudflare
        time.sleep(1)
        resource = methods.setAttr('breachedaccount/' + line)
        emailresults = methods.GET(resource)
        if emailresults is not "false":
            emailCount += 1
# ### obtaining breach information for 
            breachData = prop.getBreachAccountDetails(emailresults, line)
            breachList.append(breachData)

timestr = str(time.strftime("%Y%m%d-%H%M%S"))
filepath = "/root/breachedaccounts-" + timestr + ".csv"
prop.obtainCSV(breachList,filepath,emailCount)

end = time.time()
### time it took in seconds
print(round(end - begin))<commit_msg>Update hibp.py<commit_after>from hibpAPI import *

begin = time.time()

## hard-coded email address for testing purposes
#email = "<EMAIL>"

auth = AuthToken()
prop = ID()

### [resource = ] Sets API URI
emailCount = 0
breachList = []
methods = Methods()
with open(sys.argv[1]) as f:
    for line in f:
        line = line.strip()
        ### Need to slow it down a little so it doesn't trip Cloudflare
        time.sleep(2)
        resource = methods.setAttr('breachedaccount/' + line)
        emailresults = methods.GET(resource)
        if emailresults is not "false":
            emailCount += 1
# ### obtaining breach information for 
            breachData = prop.getBreachAccountDetails(emailresults, line)
            breachList.append(breachData)

timestr = str(time.strftime("%Y%m%d-%H%M%S"))
filepath = "/root/breachedaccounts-" + timestr + ".csv"
prop.obtainCSV(breachList,filepath,emailCount)

end = time.time()
### time it took in seconds
print(round(end - begin))
{'fraction_non_alphanumeric': 0.12941176470588237, 'fraction_numerical': 0.004092071611253197, 'mean_word_length': 3.280087527352298, 'pattern_counts': {'":': 2, '<': 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': '3790699', 'n_tokens_mistral': 624, 'n_tokens_neox': 609, 'n_words': 170}