code: def sparse_allclose(a, b, rtol=1e-5, atol=1e-8):
      
      c = np.abs(a - b) - rtol * np.abs(b)
      # noinspection PyUnresolvedReferences
      return c.max() <= atol
docs: Version of np.allclose for use with sparse matrices