code: def load_array(
      filepath,
      array_type="dense",
      array_dim=1,
      dtype="float64",
      major="row",
  ):
      """Loaf an array from disk from a format that tick C++ modules can read
  
      This method is intended to be used by developpers only, mostly for
      benchmarking in C++ on real datasets imported from Python
  
      Parameters
      ----------
      filepath : `str`
          Path where the array was stored
  
      array_type : {'dense', 'sparse'}, default='dense'
          Expected type of the array
  
      array_dim : `int`
          Expected dimension of the array
  
      dtype : {'float64', 'float32'}
          Number type of the array
  
      major : {'row', 'col'}
          Used to associate correct templated C++ class
  
      Returns
      -------
      array : `np.ndarray` or `scipy.sparse.csr_matrix`
          1d or 2d array
      """
      abspath = os.path.abspath(filepath)
      if not os.path.exists(filepath):
          raise FileNotFoundError(
              "File {} does not exists".format(abspath)
          )
  
      if dtype == "float32":
          if array_type == "dense":
              if array_dim == 1:
                  reader = tick_float_array_from_file
              elif array_dim == 2:
                  if major == "col":
                      reader = tick_float_colmaj_array2d_from_file
                  else:
                      reader = tick_float_array2d_from_file
              else:
                  raise ValueError(
                      "Only 1d and 2d arrays can be loaded"
                  )
          elif array_type == "sparse":
              if array_dim == 2:
                  if major == "col":
                      reader = tick_float_colmaj_sparse2d_from_file
                  else:
                      reader = tick_float_sparse2d_from_file
              else:
                  raise ValueError(
                      "Only 2d sparse arrays can be loaded"
                  )
          else:
              raise ValueError("Cannot load this class of array")
      elif dtype == "float64" or dtype == "double":
          if array_type == "dense":
              if array_dim == 1:
                  reader = tick_double_array_from_file
              elif array_dim == 2:
                  if major == "col":
                      reader = tick_double_colmaj_array2d_from_file
                  else:
                      reader = tick_double_array2d_from_file
              else:
                  raise ValueError(
                      "Only 1d and 2d arrays can be loaded"
                  )
          elif array_type == "sparse":
              if array_dim == 2:
                  if major == "col":
                      reader = tick_double_colmaj_sparse2d_from_file
                  else:
                      reader = tick_double_sparse2d_from_file
              else:
                  raise ValueError(
                      "Only 2d sparse arrays can be loaded"
                  )
          else:
              raise ValueError("Cannot load this class of array")
      else:
          raise ValueError("Unhandled serrialization type")
  
      return reader(filepath)
  
imports: import os
  import numpy
  import scipy
  from tick.array.build.array import tick_float_array_to_file, tick_float_array2d_to_file, tick_float_sparse2d_to_file, tick_double_array_to_file, tick_double_array2d_to_file, tick_double_sparse2d_to_file, tick_float_array_from_file, tick_float_array2d_from_file, tick_float_sparse2d_from_file, tick_double_array_from_file, tick_double_array2d_from_file, tick_double_sparse2d_from_file, tick_float_colmaj_sparse2d_to_file, tick_float_colmaj_sparse2d_from_file, tick_double_colmaj_sparse2d_to_file, tick_double_colmaj_sparse2d_from_file, tick_double_colmaj_array2d_to_file, tick_double_colmaj_array2d_from_file, tick_float_colmaj_array2d_to_file, tick_float_colmaj_array2d_from_file
label_desc: Use image node_id 2 for calling a global function with example usage: load_array(filepath, array_type, array_dim, dtype, major) and returns: reader