code: def binarize_images(data):
      binarized_data = []
      for image in data:
          image = image.reshape((62, 47))
          image_threshold = threshold_local(image, block_size=15)
          binary_adaptive_image = image > image_threshold
          binarized_data.append(binary_adaptive_image.ravel())
      return asfloat(binarized_data)
  
file_path: neupy/examples/boltzmann_machine/rbm_faces_sampling.py
imports: import itertools
  import numpy
  import matplotlib.pyplot
  from sklearn import datasets
  from sklearn.model_selection import train_test_split
  from skimage.filters import threshold_local
  from neupy import algorithms, utils
  from neupy.utils import asfloat
label_desc: Use image node_id 4 for calling a global function with example usage: binarize_images(data) and returns: asfloat