SciPy

scipy.sparse.dok_matrix.has_key

dok_matrix.has_key(k) → True if D has a key k, else False