code: def random_vectors(
      count: int,
      metric: MetricKind = MetricKind.IP,
      dtype: np.generic = np.float32,
      ndim: Optional[int] = None,
      index: Optional[Index] = None,
  ) -> np.ndarray:
      """Produces a collection of random vectors normalized for the provided `metric`
      and matching wanted `dtype`, which can both be inferred from an existing `index`.
      """
  
      # Infer default parameters from the `index`, if passed
      if index is not None:
          if not isinstance(index, Index):
              raise ValueError("Unsupported `index` type")
  
          ndim = index.ndim
          dtype = index.numpy_dtype
          metric = index.metric
  
      # Produce data
      if metric in MetricKindBitwise:
          bit_vectors = np.random.randint(2, size=(count, ndim))
          bit_vectors = np.packbits(bit_vectors, axis=1)
          return bit_vectors
  
      else:
          x = np.random.rand(count, ndim)
          if dtype == np.int8:
              x = (x * 100).astype(np.int8)
          else:
              x = x.astype(dtype)
              if metric == MetricKind.IP:
                  return x / np.linalg.norm(x, axis=1, keepdims=True)
          return x
  
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 1 for calling a global function with example usage: random_vectors(count, metric, dtype, ndim, index) and returns: bit_vectors, x, unknown