<commit_before>#!/usr/bin/python2
import alerting
import config
from backend import make_config

config = make_config(config)

db = alerting.Db(config.alerting_db)
rules = db.get_rules()
for rule in rules:
    print "rule", rule
    try:<commit_msg>allow to run from anywhere<commit_after>#!/usr/bin/python2
import alerting
from backend import make_config
import os

app_dir = os.path.dirname(__file__)
if app_dir:
    os.chdir(app_dir)

import config
config = make_config(config)

db = alerting.Db(config.alerting_db)
rules = db.get_rules()
for rule in rules:
    print "rule", rule
    try:
{'fraction_non_alphanumeric': 0.09966216216216216, 'fraction_numerical': 0.0033783783783783786, 'mean_word_length': 4.757281553398058, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7418867', 'n_tokens_mistral': 205, 'n_tokens_neox': 202, 'n_words': 56}