code: def _validate_knn_shape(nrows, k):
      if k <= 0:
          raise ValueError(
              "Invalid value of `%s` for k. k must be positive" % k
          )
      if k >= nrows:
          raise ValueError(
              """k value greater than or equal to num_rows
                              (k={}, rows={}). Lower k to a smaller
                              value.""".format(
                  k, nrows
              )
          )
  
imports: from concurrent.futures import ThreadPoolExecutor
  import os
  import shutil
  import time
  from abc import abstractmethod
  from threading import Thread
  from collections.abc import Sequence
  from pathlib import Path
  from scipy.sparse import issparse
  from annoy import AnnoyIndex
  from tqdm import tqdm
  import numpy
  from ..data import get_uint_ctype
label_desc: Use image node_id 1 for calling a global function with example usage: _validate_knn_shape(nrows, k) without return types