'Here the index is an int/str. Raises IndexError/KeyError.'

def py__getitem__(self, index):

    if (self.array_type == 'dict'):
        for (key, value) in self._items():
            for k in self._defining_context.eval_node(key):
                if (isinstance(k, compiled.CompiledObject) and (index == k.obj)):
                    return self._defining_context.eval_node(value)
        raise KeyError(('No    key    found    in    dictionary    %s.' % self))
    if isinstance(index, slice):
        return set([self])
    else:
        return self._defining_context.eval_node(self._items()[index])
