<commit_before>import collections
import claripy

class SimVariable(object):
    def __init__(self):
        pass

class SimTemporaryVariable(SimVariable):
    def __init__(self, tmp_id):
        SimVariable.__init__(self)

        self.tmp_id = tmp_id

    def __repr__(self):
        s = "<tmp %d>" % (self.tmp_id)

        return s

    def __hash__(self):
        return hash('tmp_%d' % (self.tmp_id))

    def __eq__(self, other):
        if isinstance(other, SimTemporaryVariable):
            return hash(self) == hash(other)

        else:
            return False

class SimRegisterVariable(SimVariable):
    def __init__(self, reg_offset, size):
        SimVariable.__init__(self)

        self.reg = reg_offset
        self.size = size

    def __repr__(self):
        s = "<%d %d>" % (self.reg, self.size)

        return s

    def __hash__(self):
        return hash('reg_%d_%d' % (self.reg, self.size))

    def __eq__(self, other):
        if isinstance(other, SimRegisterVariable):
            return hash(self) == hash(other)

        else:
            return False

class SimMemoryVariable(SimVariable):
    def __init__(self, addr, size):
        SimVariable.__init__(self)

        self.addr = addr
        self.size = size

    def __repr__(self):
        if type(self.size) in (int, long):
            size = '%d' % self.size
        else:
            size = '%s' % self.size

        if type(self.addr) in (int, long):<commit_msg>try my best to convert size to an integer when initializing a SimMemoryVariable<commit_after>import collections
import claripy

class SimVariable(object):
    def __init__(self):
        pass

class SimTemporaryVariable(SimVariable):
    def __init__(self, tmp_id):
        SimVariable.__init__(self)

        self.tmp_id = tmp_id

    def __repr__(self):
        s = "<tmp %d>" % (self.tmp_id)

        return s

    def __hash__(self):
        return hash('tmp_%d' % (self.tmp_id))

    def __eq__(self, other):
        if isinstance(other, SimTemporaryVariable):
            return hash(self) == hash(other)

        else:
            return False

class SimRegisterVariable(SimVariable):
    def __init__(self, reg_offset, size):
        SimVariable.__init__(self)

        self.reg = reg_offset
        self.size = size

    def __repr__(self):
        s = "<%d %d>" % (self.reg, self.size)

        return s

    def __hash__(self):
        return hash('reg_%d_%d' % (self.reg, self.size))

    def __eq__(self, other):
        if isinstance(other, SimRegisterVariable):
            return hash(self) == hash(other)

        else:
            return False

class SimMemoryVariable(SimVariable):
    def __init__(self, addr, size):
        SimVariable.__init__(self)

        self.addr = addr

        if isinstance(size, claripy.ast.BV) and not size.symbolic:
            # Convert it to a concrete number
            size = size.model.value

        self.size = size

    def __repr__(self):
        if type(self.size) in (int, long):
            size = '%d' % self.size
        else:
            size = '%s' % self.size

        if type(self.addr) in (int, long):
{'fraction_non_alphanumeric': 0.1104, 'fraction_numerical': 0.0, 'mean_word_length': 2.196319018404908, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '474224', 'n_tokens_mistral': 967, 'n_tokens_neox': 934, 'n_words': 245}