def __getitem__(self, key):
    if (key in self.d):
        return self.d[key]
    else:
        raise KeyError(key)
def __getitem__(self, key):
    if (key in self.d):
        return self.d[key]
    else:
        raise KeyError(key)