code: def encode_distance(x):
      """Encode an integer or an array of integers as a (bined) one-hot numpy array"""
  
      def _encode_distance(d):
          """Encode an integer as a (bined) one-hot numpy array"""
          dist_vect = np.zeros((11,), dtype="float32")
          if d < 64:
              dist_vect[DISTANCE_BINS[d]] = 1
          else:
              dist_vect[9] = 1
          dist_vect[10] = min(float(d), BINS_NUM) / BINS_NUM
          return dist_vect
  
      if isinstance(x, np.ndarray):
          arr_l = [_encode_distance(y)[np.newaxis, :] for y in x]
          out_arr = np.concatenate(arr_l)
      else:
          out_arr = _encode_distance(x)
      return out_arr
  
imports: from concurrent.futures import ThreadPoolExecutor, as_completed
  import os
  import numpy
  from tqdm import tqdm
label_desc: Use image node_id 1 for calling a global function with example usage: encode_distance(x) and returns: out_arr, dist_vect