code: def get_value_bucket(value, buckets, target_dtype):
      """
      :return: The bucket in the `histogram` in which our `value` falls
      """
      if buckets is None:
          return None
  
      if target_dtype in (dtype.binary, dtype.categorical):
          if value in buckets:
              bucket = buckets.index(value)
          else:
              bucket = len(buckets)  # for null values
  
      elif target_dtype in (dtype.integer, dtype.float, dtype.quantity):
          bucket = closest(buckets, value)
      else:
          bucket = len(buckets)  # for null values
  
      return bucket
  
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 1 for calling a global function with example usage: get_value_bucket(value, buckets, target_dtype) and returns: bucket, None