<commit_before>import claripy
from .plugin import SimStatePlugin

class SimRegNameView(SimStatePlugin):
    def __init__(self):
        super(SimRegNameView, self).__init__()

    def __getattr__(self, k):
        try:
            return self.state.reg_expr(self.state.arch.registers[k][0])
        except KeyError:
            return getattr(super(SimRegNameView, self), k)

    def __setattr__(self, k, v):
        if k == 'state':
            return object.__setattr__(self, k, v)

        try:
            return self.state.store_reg(self.state.arch.registers[k][0], v)
        except KeyError:
            raise AttributeError(k)

    def __dir__(self):
        return self.state.arch.registers.keys()

    def copy(self):
        return SimRegNameView()

    def merge(self, others, merge_flag, flag_values):
        return False, [ ]

    def widen(self, others, merge_flag, flag_values):
        return False, [ ]

class SimMemIndexView(SimStatePlugin):
    def __init__(self):
        super(SimMemIndexView, self).__init__()
        self._endness = None
        self._size = None
        self._addr = None
        self._signed = None

    def set_state(self, state):
        super(SimMemIndexView, self).set_state(state)
        self._endness = state.arch.memory_endness

    def _deeper(self, **kwargs):
        return SimMemIndexOverlay(self, **kwargs)

    def __getitem__(self, k):
        if isinstance(k, slice):
            return self._deeper(address=k.start, size=k.stop-k.start, endness='Iend_BE')
        elif isinstance(k, (int, long, claripy.A)):
            return SimMemIndexOverlay(self, address=k)
        else:
            raise KeyError(k)

    def __setitem__(self, k, v):
        self[k].store(v)

    attributes = {<commit_msg>Adapt for new slicing decision<commit_after>import claripy
from .plugin import SimStatePlugin

class SimRegNameView(SimStatePlugin):
    def __init__(self):
        super(SimRegNameView, self).__init__()

    def __getattr__(self, k):
        try:
            return self.state.reg_expr(self.state.arch.registers[k][0])
        except KeyError:
            return getattr(super(SimRegNameView, self), k)

    def __setattr__(self, k, v):
        if k == 'state':
            return object.__setattr__(self, k, v)

        try:
            return self.state.store_reg(self.state.arch.registers[k][0], v)
        except KeyError:
            raise AttributeError(k)

    def __dir__(self):
        return self.state.arch.registers.keys()

    def copy(self):
        return SimRegNameView()

    def merge(self, others, merge_flag, flag_values):
        return False, [ ]

    def widen(self, others, merge_flag, flag_values):
        return False, [ ]

class SimMemIndexView(SimStatePlugin):
    def __init__(self):
        super(SimMemIndexView, self).__init__()
        self._endness = None
        self._size = None
        self._addr = None
        self._signed = None

    def set_state(self, state):
        super(SimMemIndexView, self).set_state(state)
        self._endness = state.arch.memory_endness

    def _deeper(self, **kwargs):
        return SimMemIndexOverlay(self, **kwargs)

    def __getitem__(self, k):
        if isinstance(k, slice):
            if k.step is not None:
                raise ValueError("Slices with strides are not supported")
            elif k.start is None:
                raise ValueError("Must specify start index")
            elif k.stop is None:
                return self._deeper(address=k.start)
            else:
                return self._deeper(address=k.start, size=k.stop-k.start, endness='Iend_BE')
        elif isinstance(k, (int, long, claripy.A)):
            return self._deeper(address=k, size=1)
        else:
            raise KeyError(k)

    def __setitem__(self, k, v):
        self[k].store(v)

    attributes = {
{'fraction_non_alphanumeric': 0.10830512887268941, 'fraction_numerical': 0.0013017443374121322, 'mean_word_length': 2.367221735319895, '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': '3601906', 'n_tokens_mistral': 1184, 'n_tokens_neox': 1159, 'n_words': 270}