<commit_before>import base
base.reload(base)
from base import *


def start():
    return ["calc"]


def msg(mp):
    if mp.cmd('calc'):
        arg = mp.argsdef()
        try:
            main.sendcmsg('(%s) = (%s)' % (
                arg, str(c_safeeval.domath(arg))))
        except Exception as e:
            main.sendcmsg(str(e))
        return True
    return False


def showhelp(h):
    h('calc <mathematical expression>: Calculate a math expression.')<commit_msg>better error reporting<commit_after>import base
base.reload(base)
from base import *


def start():
    return ["calc"]


def msg(mp):
    if mp.cmd('calc'):
        arg = mp.argsdef()
        try:
            main.sendcmsg('(%s) = (%s)' % (
                arg, str(c_safeeval.domath(arg))))
        except Exception as e:
            main.sendcmsg('Error: ' + str(e))
        return True
    return False


def showhelp(h):
    h('calc <mathematical expression>: Calculate a math expression.')
{'fraction_non_alphanumeric': 0.14035087719298245, 'fraction_numerical': 0.0, 'mean_word_length': 2.2993197278911564, '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': '3679031', 'n_tokens_mistral': 312, 'n_tokens_neox': 299, 'n_words': 80}