<commit_before>import urllib2
import json

def getCommitSummary(url):
    m = url.split("/")
    (username, reponame, ignoreme, changeset) = m[-4:]
    try:
        apiurl = "https://api.bitbucket.org/1.0/repositories/%s/%s/changesets/%s/" % (username, reponame, changeset)
        f = urllib2.urlopen(apiurl)
        data = f.read()
    except urllib2.HTTPError:
        return "Access Denied, repository is private."
    parseddata = json.loads(data)
    revision = parseddata["revision"]
    person = parseddata["author"]
    timestamp = parseddata["timestamp"]
    branch = parseddata["branch"]
    commitmessage = parseddata["message"]

    return "%s: [%s] %s - %s - %s" % (revision, timestamp, branch, person, commitmessage)


def bitbucket(tbot, user, channel, msg):
    m = msg.split(" ")
    tbot.msg(channel, '\x0311'+str(getCommitSummary(m[0])+chr(15)))
bitbucket.rule = "https://bitbucket.org/.*/changeset/.*"<commit_msg>Cleaned up some variable names<commit_after>import urllib2
import json

def getCommitSummary(url):
    m = url.split("/")
    (username, reponame, ignoreme, changeset) = m[-4:]
    try:
        apiurl = "https://api.bitbucket.org/1.0/repositories/%s/%s/changesets/%s/" % (username, reponame, changeset)
        f = urllib2.urlopen(apiurl)
        data = f.read()
    except urllib2.HTTPError:
        return "Access Denied, repository is private."
    data = json.loads(data)
    revision = data["revision"]
    person = data["author"]
    timestamp = data["timestamp"]
    branch = data["branch"]
    commitmessage = ddata["message"]

    return "%s: [%s] %s - %s - %s" % (revision, timestamp, branch, person, commitmessage)


def bitbucket(tbot, user, channel, msg):
    m = msg.split(" ")
    tbot.msg(channel, '\x0311'+str(getCommitSummary(m[0])+chr(15)))
bitbucket.rule = "https://bitbucket.org/.*/changeset/.*"
{'fraction_non_alphanumeric': 0.16648648648648648, 'fraction_numerical': 0.014054054054054054, 'mean_word_length': 3.4818401937046004, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, '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': '1638122', 'n_tokens_mistral': 635, 'n_tokens_neox': 635, 'n_words': 133}