code: def check_precomputed_distance_matrix(X):
      
      tmp = X.copy()
      tmp[np.isinf(tmp)] = 1
      check_array(tmp)
docs: Perform check_array(X) after removing infinite values (numpy.inf) from the given distance matrix.