<commit_before>class Model(object):
    pass


class User(Model):
    @classmethod
    def from_json(cls, json):
        if json:
            return cls(json['name'], json['displayName'], json.get('emailAddress'))

    def __init__(self, username, name, email=None):
        self.username = username
        self.name = name
        self.email = email

    def __str__(self):
        return '{} ({})'.format(self.name, self.username)


class Issue(Model):
    @classmethod
    def from_json(cls, json):
        issue = cls(json['key'])

        if 'fields' in json:
            fields = json['fields']
            issue.summary = fields['summary']
            issue.description = fields.get('description')
            issue.creator = User.from_json(fields.get('creator'))
            issue.assignee = User.from_json(fields.get('assignee'))
            issue.status = Status.from_json(fields['status'])

            if 'resolution' in fields:
                issue.resolution = Resolution.from_json(fields['resolution'])
            else:
                issue.resolution = None

            links = []
            if 'issuelinks' in fields:
                links = [IssueLink.from_json(link) for link in fields['issuelinks']]
            issue.links = links<commit_msg>fix(client): handle api returning resolution as null<commit_after>class Model(object):
    pass


class User(Model):
    @classmethod
    def from_json(cls, json):
        if json:
            return cls(json['name'], json['displayName'], json.get('emailAddress'))

    def __init__(self, username, name, email=None):
        self.username = username
        self.name = name
        self.email = email

    def __str__(self):
        return '{} ({})'.format(self.name, self.username)


class Issue(Model):
    @classmethod
    def from_json(cls, json):
        issue = cls(json['key'])

        if 'fields' in json:
            fields = json['fields']
            issue.summary = fields['summary']
            issue.description = fields.get('description')
            issue.creator = User.from_json(fields.get('creator'))
            issue.assignee = User.from_json(fields.get('assignee'))
            issue.status = Status.from_json(fields['status'])

            resolution = fields.get('resolution', None)
            if resolution:
                issue.resolution = Resolution.from_json(resolution)
            else:
                issue.resolution = None

            links = []
            if 'issuelinks' in fields:
                links = [IssueLink.from_json(link) for link in fields['issuelinks']]
            issue.links = links
{'fraction_non_alphanumeric': 0.12409038682497127, 'fraction_numerical': 0.0, 'mean_word_length': 2.1699029126213594, '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': '2794871', 'n_tokens_mistral': 730, 'n_tokens_neox': 697, 'n_words': 160}