code: def test_BinaryClassificationEvaluator_find_best_accuracy_and_threshold() -> (
      None
  ):
      """Tests that the Acc score for the computed threshold is correct"""
      y_true = np.random.randint(0, 2, 1000)
      y_pred_cosine = np.random.randn(1000)
      (
          max_acc,
          threshold,
      ) = evaluation.BinaryClassificationEvaluator.find_best_acc_and_threshold(
          y_pred_cosine, y_true, high_score_more_similar=True
      )
      y_pred_labels = [
          1 if pred >= threshold else 0 for pred in y_pred_cosine
      ]
      sklearn_acc = accuracy_score(y_true, y_pred_labels)
      assert np.abs(max_acc - sklearn_acc) < 1e-6
  
file_path: sentence-transformers/tests/test_evaluator.py
imports: import csv
  import gzip
  import os
  import numpy
  from sklearn.metrics import accuracy_score, f1_score
  from torch.utils.data import DataLoader
  from sentence_transformers import InputExample, SentenceTransformer, evaluation, losses, util
label_desc: Use image node_id 2 for calling a global function with example usage: test_BinaryClassificationEvaluator_find_best_accuracy_and_threshold() without return types