<commit_before>#!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4

import os


urlpatterns = []


# load the rapidsms configuration
from rapidsms.config import Config
conf = Config(os.environ["RAPIDSMS_INI"])


# iterate each of the active rapidsms apps (from the ini),
# and (attempt to) import the urls.py from each. it's okay
# if this fails, since not all apps have a webui

for rs_app in conf["rapidsms"]["apps"]:
    package_name = "apps.%s.urls" % (rs_app["type"])
    module = __import__(package_name, {}, {}, ["urlpatterns"])
    urlpatterns += module.urlpatterns

<commit_msg>wrapped url importing in a try<commit_after>#!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4

import os


urlpatterns = []


# load the rapidsms configuration
from rapidsms.config import Config
conf = Config(os.environ["RAPIDSMS_INI"])


# iterate each of the active rapidsms apps (from the ini),
# and (attempt to) import the urls.py from each. it's okay
# if this fails, since not all apps have a webui

for rs_app in conf["rapidsms"]["apps"]:
    try:
	package_name = "apps.%s.urls" % (rs_app["type"])
	module = __import__(package_name, {}, {}, ["urlpatterns"])
	urlpatterns += module.urlpatterns
    except Exception, e:
        continue


{'fraction_non_alphanumeric': 0.12753858651502845, 'fraction_numerical': 0.00487408610885459, 'mean_word_length': 4.264957264957265, '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': '1176330', 'n_tokens_mistral': 434, 'n_tokens_neox': 421, 'n_words': 136}