docstr: Either loads an existing dataset from disk, or generates one on the fly.
  
  :param vectors: _description_, defaults to None
  :type vectors: Optional[str], optional
  :param queries: _description_, defaults to None
  :type queries: Optional[str], optional
  :param neighbors: _description_, defaults to None
  :type neighbors: Optional[str], optional
  :param count: _description_, defaults to None
  :type count: Optional[int], optional
  :param ndim: _description_, defaults to None
  :type ndim: Optional[int], optional
  :param k: _description_, defaults to None
  :type k: Optional[int], optional
code: def build(
      vectors: Optional[str] = None,
      queries: Optional[str] = None,
      neighbors: Optional[str] = None,
      count: Optional[int] = None,
      ndim: Optional[int] = None,
      k: Optional[int] = None,
  ):
      """Either loads an existing dataset from disk, or generates one on the fly.
  
      :param vectors: _description_, defaults to None
      :type vectors: Optional[str], optional
      :param queries: _description_, defaults to None
      :type queries: Optional[str], optional
      :param neighbors: _description_, defaults to None
      :type neighbors: Optional[str], optional
      :param count: _description_, defaults to None
      :type count: Optional[int], optional
      :param ndim: _description_, defaults to None
      :type ndim: Optional[int], optional
      :param k: _description_, defaults to None
      :type k: Optional[int], optional
      """
  
      d = Dataset(None, None, None, None)
  
      if vectors is not None:
          assert ndim is None
  
          d.vectors = load_matrix(vectors)
          ndim = d.vectors.shape[1]
          count = (
              min(d.vectors.shape[0], count)
              if count is not None
              else d.vectors.shape[0]
          )
          d.vectors = d.vectors[:count, :]
          d.keys = np.arange(count, dtype=Key)
  
          if queries is not None:
              d.queries = load_matrix(queries)
          else:
              d.queries = d.vectors
  
          if neighbors is not None:
              d.neighbors = load_matrix(neighbors)
              if k is not None:
                  d.neighbors = d.neighbors[:, :k]
          else:
              assert (
                  k is None
              ), "Cant ovveride `k`, will retrieve one neighbor"
              d.neighbors = np.reshape(d.keys, (count, 1))
  
      else:
          assert ndim is not None
          assert count is not None
          assert (
              k is None
          ), "Cant ovveride `k`, will retrieve one neighbor"
  
          d.vectors = random_vectors(count=count, ndim=ndim)
          d.queries = d.vectors
          d.keys = np.arange(count, dtype=Key)
          d.neighbors = np.reshape(d.keys, (count, 1))
  
      return d
  
imports: from __future__ import annotations
  from time import time_ns
  from typing import Tuple, Any, Callable, Union, Optional, List
  from dataclasses import dataclass, asdict
  from collections import defaultdict
  from math import ceil
  import numpy
  from usearch.io import load_matrix
  from usearch.index import Index, Matches, BatchMatches, MetricKind, MetricKindBitwise, Key
label_desc: Use image node_id 2 for calling the Dataset obj's underlying member method code with example usage: obj.build(vectors, queries, neighbors, count, ndim, k) and returns: d