def __getitem__(self, key):
        # This is a workaround to make TaskResource non-iterable
        # over simple index-based iteration
        try:
            int(key)
            raise StopIteration
        except __HOLE__:
            pass

        if key not in self._data:
            self._data[key] = self._deserialize(key, None)

        return self._data.get(key)
dataset/ETHPy150Open robgolding63/tasklib/tasklib/task.py/TaskResource.__getitem__