def __contains__(self, key):
    if (key == 'distances'):
        return (self._distances is not None)
    elif (key == 'connectivities'):
        return (self._connectivities is not None)
    else:
        return (key in self._neighbors_dict)
def __contains__(self, key):
    if (key == 'distances'):
        return (self._distances is not None)
    elif (key == 'connectivities'):
        return (self._connectivities is not None)
    else:
        return (key in self._neighbors_dict)