code: def closest(arr, value):
      """
      :return: The index of the member of `arr` which is closest to `value`
      """
      if value is None:
          return -1
  
      for i, ele in enumerate(arr):
          value = float(str(value).replace(",", "."))
          if ele > value:
              return i - 1
  
      return len(arr) - 1
  
file_path: lightwood/lightwood/analysis/helpers/acc_stats.py
imports: import random
  from types import SimpleNamespace
  from typing import Dict, Optional
  import numpy
  from sklearn.metrics import confusion_matrix
  from type_infer.dtype import dtype
  from lightwood.analysis.base import BaseAnalysisBlock
  from mindsdb_evaluator import evaluate_accuracies
label_desc: Use image node_id 2 for calling a global function with example usage: closest(arr, value) and returns: unknown, unknown, unknown