<commit_before>class Workitem:
    def __init__(self, obj):
        self.id = obj["id"]
        self.summary = obj["summary"]
        self.description = obj["description"]
        self.project = obj["projectArea"]["name"]
        self.url = "%s/resource/itemName/%s/%s" % (obj["reportableUrl"].split("/rpt")[0], obj["itemType"], obj["id"])
        self.state = obj["state"]["name"]
        self.type = obj["type"]["name"]
        self.owned_by = obj["owner"]["name"]
        self.created_by = obj["creator"]["name"]
        self.filed_against = obj["category"]["qualifiedName"]
        self.severity = obj["severity"]["name"]
        self.priority = obj["priority"]["name"]
        self.creation_date = obj["creationDate"]
        self.due_date = obj["dueDate"]

        if "comments" in obj:
            self.comments = [{"comment": comment["content"],
                              "creator": comment["creator"]["name"],
                              "creationDate": comment["creationDate"]} for comment in obj["comments"]]

        # TODO: Allow a tag to contain a pipe. At the moment it splits them.
        if obj["tags"] is not None:
            self.tags = obj["tags"].split("|")
        else:
            self.tags = None

        if "stringComplexity" in obj:
            self.points = obj["stringComplexity"]<commit_msg>Fixed bug where comment chains of length 1 would throw exception<commit_after>class Workitem:
    def __init__(self, obj):
        self.id = obj["id"]
        self.summary = obj["summary"]
        self.description = obj["description"]
        self.project = obj["projectArea"]["name"]
        self.url = "%s/resource/itemName/%s/%s" % (obj["reportableUrl"].split("/rpt")[0], obj["itemType"], obj["id"])
        self.state = obj["state"]["name"]
        self.type = obj["type"]["name"]
        self.owned_by = obj["owner"]["name"]
        self.created_by = obj["creator"]["name"]
        self.filed_against = obj["category"]["qualifiedName"]
        self.severity = obj["severity"]["name"]
        self.priority = obj["priority"]["name"]
        self.creation_date = obj["creationDate"]
        self.due_date = obj["dueDate"]

        if "comments" in obj:
            if not isinstance(obj["comments"], list):
                self.comments = [{"comment": obj["comments"]["content"],
                                  "creator": obj["comments"]["creator"]["name"],
                                  "creationDate": obj["comments"]["creationDate"]}]
            else:
                self.comments = [{"comment": comment["content"],
                                  "creator": comment["creator"]["name"],
                                  "creationDate": comment["creationDate"]} for comment in obj["comments"]]

        # TODO: Allow a tag to contain a pipe. At the moment it splits them.
        if obj["tags"] is not None:
            self.tags = obj["tags"].split("|")
        else:
            self.tags = None

        if "stringComplexity" in obj:
            self.points = obj["stringComplexity"]
{'fraction_non_alphanumeric': 0.16749093306956808, 'fraction_numerical': 0.0009891196834817012, 'mean_word_length': 2.251875669882101, 'pattern_counts': {'":': 9, '<': 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': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2530127', 'n_tokens_mistral': 839, 'n_tokens_neox': 847, 'n_words': 183}