

def __getitem__(self, item):
    try:
        if isinstance(item, unicode):
            return getattr(self.target, item.encode('ascii'))
        return getattr(self.target, item)
    except (AttributeError, UnicodeError):
        raise KeyError(item)

dataset/ETHPy150Open jek/flatland/flatland/util/base.py as_mapping.__getitem__/original