code: def __init__(
      self,
      tempdir: str,
      dimension: int,
      data_type: np.dtype,
      index_factory: Optional[List] = ["OPQ4,IVF256,PQ4"],
      training_sample: Optional[int] = 9984,
      index_shard_size: Optional[int] = 1000,
      query_batch_size: Optional[int] = 1000,
      evaluation_sample: Optional[int] = 100,
      num_files: Optional[int] = None,
      file_size: Optional[int] = None,
      file_sizes: Optional[List] = None,
      nprobe: Optional[int] = 64,
      k: Optional[int] = 10,
      metric: Optional[str] = "METRIC_L2",
      normalise: Optional[bool] = False,
      with_queries_ds: Optional[bool] = False,
      evaluate_by_margin: Optional[bool] = False,
  ) -> None:
      self.tempdir = tempdir
      self.dimension = dimension
      self.data_type = np.dtype(data_type).name
      self.index_factory = {"prod": index_factory}
      if file_size and num_files:
          self.file_sizes = [file_size for _ in range(num_files)]
      elif file_sizes:
          self.file_sizes = file_sizes
      else:
          raise ValueError("no file sizes provided")
      self.num_files = len(self.file_sizes)
      self.training_sample = training_sample
      self.index_shard_size = index_shard_size
      self.query_batch_size = query_batch_size
      self.evaluation_sample = evaluation_sample
      self.nprobe = {"prod": [nprobe]}
      self.k = k
      self.metric = metric
      self.normalise = normalise
      self.config_file = self.tempdir + "/config_test.yaml"
      self.ds_name = "my_test_data"
      self.qs_name = "my_queries_data"
      self.evaluate_by_margin = evaluate_by_margin
      self.with_queries_ds = with_queries_ds
  
file_path: faiss/demos/offline_ivf/tests/testing_utils.py
imports: import argparse
  import yaml
  import numpy
  from typing import Dict, List, Optional
label_desc: Use image node_id 1 to create a new TestDataCreator object  with example: obj = TestDataCreator(tempdir, dimension, data_type, index_factory, training_sample, index_shard_size, query_batch_size, evaluation_sample, num_files, file_size, file_sizes, nprobe, k, metric, normalise, with_queries_ds, evaluate_by_margin)